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