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

Posted by "Richard Lynch" on 07/11/05 04:34

On Sat, July 9, 2005 1:39 am, Ahmed Abdel-Aliem said:
> Hi
> i have a problem with a code to upload files on server
> here is the code
>
> $f =& $HTTP_POST_FILES['News_Pic'];

Use $_FILES to stay current...

> $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'];

So, what happened to $dst_file_name?

Far as I can tell, you've never used it...

> $r = move_uploaded_file($f['tmp_name'], $dest);

> $News_Pic = $f['name'];
> chmod($dest, 777);

Nooooooooooooooo!

You should *NOT* be trying to make the files 777.

And it should be 0777 anyway.

--
Like Music?
http://l-i-e.com/artists.htm

 

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

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