473,387 Members | 1,925 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,387 software developers and data experts.

How to make file uploading work in Internet Explorer?

1
Hello,

I have wrote code that uploads files from user's hard disks to the server and everything works fine in Firefox and Safari, but in Internet Explorer it uploads dummy files and cycles that. So when I try to upload one photo, I get a lot of dummy files on my server and a lot of record in MySQL insted of one record.

I guess the problem in JS:

[PHP]<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT">
<!--

imageWait = new Image(); imageWait.src = "http://www.roamearth.com/img/wait.gif";

function showWaitImage() {
document.getElementById('photoSubmit').disabled = true;
document.getElementById('photoSubmit').value='Зака чивается...';
var showMap = document.getElementById("showMap");
showMap.innerHTML = '<iframe src="http://www.roamearth.com/empty.html" frameBorder=0 scrolling=no></iframe>';
var mapThisPhoto = document.getElementById("mapThisPhoto");
mapThisPhoto.innerHTML = '<span></span>';

parent.changeFrameSizePhoto();
var div = document.getElementById("image");
div.innerHTML = '<table width="100%" cellspacing="0" cellpadding="0"><tr><td align="center"><span class="style">Фотография закачивается, пожалуйста подождите...<br /><br />&nbsp;<br />&nbsp;<br /><img src="http://www.roamearth.com/img/wait.gif" id="myImage" /></span></td></tr></table>';
document.getElementById("myImage").onload = function() {
document.getElementById("photoForm").submit();
}
return false;
}

//-->
</SCRIPT>[/PHP]

The form looks like it's ok:
[PHP]<form name="photoForm" id="photoForm" action="uploadsub.php?geo=3017382&dest=&typet=ph&l ang=ru" method="post" enctype="multipart/form-data"><input type="hidden" name="MAX_FILE_SIZE" value="4000000" /><input size="15" name="url" type="file" style="border:1px solid #777777" class="style">
<input value="Закачать" type="submit" class="style" name="photoSubmit" id="photoSubmit" onclick="return showWaitImage()"></form>[/PHP]

In ShowWaitImage() function everthing works until this:
[PHP]document.getElementById("myImage").onload = function() {
document.getElementById("photoForm").submit();
}[/PHP]

I wonder what part of code doesn't work in IE? Why that happens?

PS: Live example is here (login "test", pass "thetest"):
http://www.roamearth.com/upload.php?...&tpage=country
Jan 5 '08 #1
1 1995
acoder
16,027 Expert Mod 8TB
It may have something to do with how IE loads images. Why are you submitting the form on image load?
Jan 7 '08 #2

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

Similar topics

7
by: Gefster | last post by:
I'm writing an uploading page for a website I'm working on. This website will hopefully allow users to upload files of up to 100MB in size. The web administrator has increased all the limiting...
3
by: wj | last post by:
Hi all, I've got some problems uploading files using apache and php on a local Windows PC. I'm using the file upload example from the manual, but i can't get it to work. I don't get an error...
2
by: Raymond H. | last post by:
Hello, I create a vb4 project which can also naviger on Internet via the WebBrowser control which I put on my form. My question is: if this program is installed on a station having already...
0
by: Mike | last post by:
Hi, I'm psoting a file to my webserver IIS 5, win 2k. This is the lines of code it errors on the last line Set streamFile = Server.CreateObject("ADODB.Stream") streamFile.Type = 1...
5
by: Tim Mulholland | last post by:
I am trying to create an ASPX page that, based on QueryString inputs, returns another file, in this case a WMA file. I do not want to do this by redirect, because these files are not available...
1
by: Ersin Gençtürk | last post by:
hi , I need to customize <input type=file , tag. I find a way to do that : on the client side by javascript and css first , I am hiding the fileupload object , then I am calling the click...
7
by: TLM | last post by:
I am trying to build a web application that will contain links to files on a users local computer. I am assuming that the files will be in a known location and can display in a browser window. ...
48
by: Nathan Sokalski | last post by:
Ever since I found out that they didn't give us a way to install both IE6 and IE7 on the same machine, I have been more frustrated and annoyed with Microsoft than I ever have been with any company...
0
by: sandhyamn | last post by:
hi....i am writing a jsp code for uploading file inside a folder using multipart/form-data.but also i want to write textbox values in to that file, but the textbox values is not coming. ie..textbox...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.