You are here: Re: [PHP] Handling File uploads pre 4.2.0 « PHP « IT news, forums, messages
Re: [PHP] Handling File uploads pre 4.2.0

Posted by Richard Lynch on 10/04/42 11:10

>
> I need a way to make sure an upload has been "uploaded" correctly to my
> server.
>
> I know version 4.2.0 has the $_FILE['userfile']['error'] directive but
> unfortunately I'm stuck with verision 4.1.2 at the moment and upgrading
> may be a way off for me.
>
> Should I use file_exists($_FILES['userfile']['tmp_name'] to see if it
> exists before moving it to wherever I'm moving it too?

First make sure that the name isn't the empty string, nor that it is ==
"none" because those are conditions that indicate no file was chosen or
that upload failed.

I'm pretty sure move_uploaded_file() checks for the file existence for
you, so that's not really needed.

--
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

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