upload file problem
| From: | Ahmed Abdel-Aliem | Date: | Sat, 09 Jul 2005 08:39:54 +0000 |
| Subject: | upload file problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-218379@lists.php.net to get a copy of this message | ||
Hi
i have a problem with a code to upload files on server
here is the code
$f =& $HTTP_POST_FILES['News_Pic'];
$dst_file_name = generateUniqueId();
$arr = split("\.",$f['name']);
$f['name'] = $dst_file_name;
$f['name'] .= ".".$arr[count($arr)-1];
$dest_dir = 'main/pictures';
$dest = $dest_dir . '/' .$f['name'];
$r = move_uploaded_file($f['tmp_name'], $dest);
$News_Pic = $f['name'];
chmod($dest, 777);
after uploading a file i check the folder and i find nothing uploaded
and when i check the MySQL Table for the filed of the name of the
picture i find this
ef26fc32a2855a4edb6ef389b8b621af.
it should be that random number followed by the extension, for example :
ef26fc32a2855a4edb6ef389b8b621af.jpg
but this deosn't happen and the file is not uploaded
can anyone help me with this plz ?
--
Ahmed Abdel-Aliem
Web Developer
www.ApexScript.com
0101108551
registered Linux user number 382789