Page 1 of 1

trouble with image upload

Posted: Tue Apr 04, 2006 10:25 am
by flann
A few days ago I went through the following tutorial viewtopic.php?t=41743 and it works great. The only problem that I'm having now, is that when using IE and trying to upload a .jpg file, it doesn't work. It works with .gif in IE, and both .gif and .jpg with Firefox, but not .jpg and IE. Does anybody know of any bug out there that I need to fix?

Posted: Tue Apr 04, 2006 10:33 am
by JayBird
In what way doesn't it work?

Posted: Tue Apr 04, 2006 10:38 am
by feyd
onion2k's script looks at the submitted mime-type. IE sends image/pjpeg typically for jpeg files. Looking at the mime-type submission is dangerous as that information is very easily forged. Use getimagesize() instead.

Posted: Tue Apr 04, 2006 10:38 am
by flann

Code: Select all

Warning: imagegif(): supplied argument is not a valid Image resource in /productInsert.php on line 26

Warning: imagesx(): supplied argument is not a valid Image resource in /productInsert.php on line 32

Warning: imagesy(): supplied argument is not a valid Image resource in /productInsert.php on line 32

Warning: imagesx(): supplied argument is not a valid Image resource in /productInsert.php on line 41

Warning: imagesy(): supplied argument is not a valid Image resource in /productInsert.php on line 42

Warning: imagecreatetruecolor(): Invalid image dimensions in /productInsert.php on line 45

Warning: imagesx(): supplied argument is not a valid Image resource in /productInsert.php on line 46

Warning: imagesy(): supplied argument is not a valid Image resource in /productInsert.php on line 46

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /productInsert.php on line 46

Warning: imagegif(): supplied argument is not a valid Image resource in /productInsert.php on line 48
once again it works fine in firefox and .gif's work fine in IE, just not .jpg in IE

Posted: Tue Apr 04, 2006 10:43 am
by flann
why does IE send image/pjpeg as the mime type? I'm just curious

Posted: Tue Apr 04, 2006 10:44 am
by feyd
Why did Microsoft make MS Bob? Both have the same answer: because they could.