Heres the deal. I'm just trying to upload a jpeg image to the server. simple enough. I know that macs and windows machine interpret mime types differently. Mac reads 'image/jpeg' while the windows machine reads 'image/pjpeg'.
So I have written some code that checks whether it's a jpeg:
if ($_FILES['photo'] ['type'] != 'image/jpeg' || $_FILES['photo'] ['type'] != 'image/pjpeg'){
html_header('Landlord Account','logged_in');
print_message('The image is not a jpeg.');
html_url('edit_property_photo.php','Please Try Again');
html_footer('edit_property', $sess_first_name);
exit;
}
When I leave out the
$_FILES['photo'] ['type'] != 'image/pjpeg'
it works fine on my mac but if I add it no go. It's an 'or' statement. Any idea why it's not returning true since part of the statement checks out.
ahhh, i just noticed that it says 'if the file doesn't equal jpeg return false or if it doesn't equal pjpeg return false. well on the mac it doesn't equal pjpeg and the statement returns true. now just to rewrite it so it works
so the final code that worked is:
if (!$_FILES['photo'] ['type'] == 'image/jpeg' || !$_FILES['photo'] ['type'] == 'image/pjpeg'){}
Mahalo for the help,
Mike