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 /> <br /> <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