By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,373 Members | 1,792 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,373 IT Pros & Developers. It's quick & easy.

Upload script - not workin in IE 6

100+
P: 144
hi,

i dunno why, but i have tested my upload script with IE 6. but the file wasn't uploaded. it works fine with Opera and FF. i use php 5.1.2

here is my upload script

[PHP]
//get the picture file
//validation on type and size
$fileName = '';
if(($_FILES['picture']['type'] == 'image/jpeg' || $_FILES['picture']['type'] == 'image/png')&& $_FILES['picture']['size'] < 3000000)
{
//user picture file name is the same with user key
//get user key
/*** query process ***/

$fileName = 'sameWithUserKey';

//move the uploaded file
move_uploaded_file($_FILES['picture']['tmp_name'], "../images/imgs/".$fileName);
}
[/PHP]

though maybe something wrong with it.

thx
Dec 26 '07 #1
Share this Question
Share on Google+
3 Replies


Markus
Expert 5K+
P: 6,050
I'm guessing you're trying to upload a jpeg because most images are jpeg, so here goes..

IE being IE is a little bit poo and creates it's own unnecessary rules.

try adding this to your if(imagetype ==) statement

[php]
if(($_FILES['picture']['type'] == 'image/jpeg'
|| $_FILES['picture']['type'] == 'image/png'
|| $_FILES['picture']['type'] == 'image/pjpeg') //*added this line
&& $_FILES['picture']['size'] < 3000000)
[/php]

* pjpeg is how IE recognises jpegs... stupid, eh?

Hope this helps

seasons greetings
Dec 26 '07 #2

100+
P: 144
thx, markusn00b

it works. haha, web programming and designing is challenging maybe because i'm in the process of learning. we have to test it on more than one browser.
Dec 27 '07 #3

Markus
Expert 5K+
P: 6,050
thx, markusn00b

it works. haha, web programming and designing is challenging maybe because i'm in the process of learning. we have to test it on more than one browser.
The process of learning is something you will never leave - and anyone else for that matter.

Glad it works :)

post back whenever you need to.

Seasons greetings
Dec 27 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.