You are here: Re: 2 ques on image upload « All PHP « IT news, forums, messages
Re: 2 ques on image upload

Posted by steve on 06/30/05 07:19

so, what you're saying is that this code:

| if ($userfile_type != 'image/pjpeg')
| {
| echo 'Problem: file is not jpg image';
| exit;
| }

returns the echo'ed statement? other than 'image/pjpeg' is a loosy-goosy way
to check the file type...my first suggestion would be to check the most
common type...'image/jpg'. i would echo the $userfile_type and just copy the
value it shows and put it in the above code section.

however, jpg's can be jpg, jpeg, etc., etc. the extension of a file has
*nothing* to do with the type of format the data is in...in windows, it only
helps the os pick associated applications to shell out to in order to
show/handle the data being accessed. in 'nix, file extensions are still
quite meaningless.

there are better alternatives to be had if you want to *strictly* determine
that the file is, in fact, a jpg formatted file. google returns several good
starts relating to php and upload file examination.

hth,

steve

 

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

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