PHP Fileupload with gif progress animation

Hello,

I am using PHP and a simple HTML form to upload images, and I could care less about monitoring the actual progress. I just want an animated gif to cycle while the files upload.

The problem is that the browser causes the gif to stop animating when the file transfers. I have the form targeting an invisible iframe.

What can I do to make the gif keep animating through the file transfer? Is there some iframe combination I can use? I am pretty sure it is possible because in an example I found:

It seems like the gif animates through the transfer. However I was unable to reverse engineer that script.

Thanks,
Ian Williamson

I’ve done it in a popup before (form onsubmit) and it keeps animating, and then use the body onunload event to close it

You could just have somthing like this…

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >

	<head>
		<title>Upload</title>

		<script language="javascript">
			function showit()
			{
			loading.style.display="";
			setTimeout('document.form1.submit()',4000);
			}
		</script>

       </head>

	<body >
        <div id="loading" style="display:none;padding:20px;">
		   <img src="images/uploading.gif" border="0">
	</div>

	<form action="includes/upload.php" method="post"
                 enctype="multipart/form-data" name="form1">
		      <input name="userfile" type="file" id="userfile" >
		      <input name="Submit" type="button" id="Submit"
                         value="Submit"  onClick="showit();">
		</form>

        </body>
</html>

not sure if HTML_Progress can help you…otherwise I like the [URL=http://www.raditha.com/php/progress.php]Mega Upload script. Have a look…

That looks like it is causing the form to wait to submit. I want it to submit normally.