473,382 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Upload script - not workin in IE 6

144 100+
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
3 1468
Markus
6,050 Expert 4TB
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
thesti
144 100+
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
6,050 Expert 4TB
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

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

Similar topics

4
by: Tihon | last post by:
Hello! I again need your help, just can't understand whats going on. Got this upload pictures form and it's having problem handling large files (~1.5 - 2 MB). Everything works fine if i just...
1
by: PeterB | last post by:
Hi! I'm using Pure ASP File Upload (http://www.asp101.com/articles/jacob/scriptupload.asp) to upload a file from a client to a server. I am testing both on a local IIS and a remote server. The...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
9
by: Steve Poe | last post by:
I work for an animal hospital trying to use PHP to store an animal's dental x-rays to a file server. I can browse for the xray on the local desktop computer then click "Upload Image". This...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.