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
https://forums.phpfreaks.com/topic/211717-iframe-not-refreshing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.