You are here: Re: [PHP] Image upload form « PHP « IT news, forums, messages
Re: [PHP] Image upload form

Posted by Jack Jackson on 06/15/05 20:26

Yes, Jason,
Those did it!

Thanks so much for the help!



Jason Wong wrote:
> On Thursday 16 June 2005 00:38, Jack Jackson wrote:
>
>
>>//try to get image size; this returns false if this is not an actual
>>image file.
>> $image_test = getimagesize($local_file);
>> if ($image_test !== false) {
>> $mime_type = $_FILES['userfile']['type'];
>
>
> $_FILES['userfile']['type'] contains the mime-type that is provided by the
> browser and will vary depending on browser and hence extremely
> unreliable.
>
> In fact the returned value from getimagesize() already has mime-type info,
> use that instead.
>
>
>> $newfile = md5(date("l-F-j-Y i:s")).'.'.$pext;
>>
>> $image_file = $uploaddir . $newfile;
>>
>>// print_r($newfile);
>>// print_r($image_file);
>>
>> if(!move_uploaded_file($newfile,$image_file)) {
>>
>> echo 'Could not move file to destination';
>> exit;
>> }
>
>
> The file pointed to by $newfile doesn't exist. You need to move ...
>
>
>> $local_file = $_FILES['userfile']['tmp_name'];
>
>
> ... $localfile
>
>

 

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

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