Code: Select all
<script>
<!--
// Toggle your div layer's visibility or whatever you want to do
// Now submit your form to begin uploading the file
document.myForm.submit();
// You will generate a token from php and put it in a hidden form field, this way you can associate the RPC request with the right user
token = document.myForm.token;
// Your RPC call
document.myIFrame.location = 'http://example.com/rpc.php?token=' + token;
function updateStatus(msg) {
// This code will output msg to the div layer
}
-->
</script>1) make a parent call to the page where you are uploading the file from, calling the updateStatus() command, this call will output status information to the div layer, (for example it could output the bytes uploaded so far)
2) it would output a meta refresh tag to refresh itself in 1 second (when refreshing it would also re-send the token)
As for getting rpc.php to stat the filesize of the file you are uploading, you are on your own on that one.
Once you get the above working you could use some other method, like feyd suggested for obtaining the TOTAL file size, from there you could dispaly as detailed information such as upload progress.
Good luck, and if you get this thing working let me know!