You are here: upload file problem « PHP « IT news, forums, messages
upload file problem

Posted by Ahmed Abdel-Aliem on 07/09/05 11:39

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация