File Uploads Help!!!
| From: | Jason Todd Slack-Moehrle | Date: | Fri, 05 Dec 2008 22:11:51 +0000 |
| Subject: | File Uploads Help!!! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-284204@lists.php.net to get a copy of this message | ||
Hi All,
I am uploading a file and it says it worked, but I dont see it in the directory
Here is my code so far:
$allowed_ext = array('csv','xls');
$ext = end(explode('.',$_FILES['uploadedfile']['name']));
$ran2 = rand().".";
$target = "tempUploads/";
$target = $target . $ran2.$ext;
if($_FILES['uploadedfile']['size'] > 2000000){
$message = 'File over 2MB';
echo $message;
exit;
}
if($message == NULL && !in_array($ext,$allowed_ext)){
$message = 'File extension not allowed'.' extension is:'.$ext;
echo $message;
exit;
}
if($message == NULL) {
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target))
{
$message = "Uploaded The File.";
echo $message;
// upload was successful, now lets work with it
include '_functions.inc'; // Utility Functions
include '_fileHeaders.inc'; // CSV File Headers that we expect, in the proper order
include '_fileParse.inc'; // CSV File Parsing
}
else
{
$message = "Sorry, there was a problem uploading your file.";
echo $message;
}
}
How can I verify it is there? I ftp in and I dont see it.
-Jason