Jump to content

iframe not refreshing


akshay

Recommended Posts

Hello.

 

I'm using a PHP/CGI Upload Script -tesUpload.

 

U can see the uploader at http://www.mintload.com/upload/upload-single.php

 

As you can see, the percentage doesnt reload (its an iframe). On Firefox, if u right click on frame (0%) and select "open frame in new tab" or show only frame, u see it movin' and refreshing.

 

Basically the iframe /fileprog.php calculates the percentage uploaded and refreshes itself to get new percentage every second.

 

The code for upload-single.php is :

 

<?php 
require_once("upload_helper.php"); 
$sid = md5(uniqid(rand()));
?>
<html>
<head>

<script language="javascript" type="text/javascript" src="upload.js"></script>
<link rel="stylesheet" href="upload.css" type="text/css" media="screen" title="Upload" charset="utf-8" />
  <script language="javascript">
    function beginUpload(sid) {
      document.postform.submit();
    	var pb = document.getElementById("progress");
    	pb.parentNode.parentNode.style.display='block';
    	new ProgressTracker(sid,{
    		progressBar: pb,
    		onFailure: function(msg) {
    			Element.hide(pb.parentNode);
    			alert(msg);
    		}
    	});
    }
  </script>
</head>
<body>

<form target="_top" enctype="multipart/form-data" name="postform" action="/cgi-bin/upload.cgi?sid=<?php echo $sid; ?>&target=<?php echo normal_target('receive.php') ?>" method="post">
	<div class="inputhead">File 1</div>
	<input type="file" size="50" name="file_1" /><br/>
</form>
<div id="progressbox" style="display: none;"><img src="http://www.remit2home.com/remittance/images/mmm_loading.gif" alt="uploading..."> Uploading now...
   <div class="progresscontainer"><div class="progressbar" id="progress"></div></div>
</div>
<iframe src="http://mintload.com/upload/fileprog.php?sid=<?php echo $sid; ?>" width=50 height=50 frameborder=0 border=0 allowtransparency="true" ></iframe> uploaded
<!--img src="http://www.remit2home.com/remittance/images/mmm_loading.gif" alt="uploading..."-->
<!--iframe for percentage-->
<p align="right"><input type="image" src="http://mintload.com/images/btn_upload.png" onclick="beginUpload('<?php echo $sid ?>');" alt="Upload" ></p>

</body>
</html>

 

fileprog.php is alright. I need the percentage in iframe to refresh even when embedded onto upload-single.php

 

Please help

 

 

Thank you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.