A "Upload Progress Bar" Concept?? Anything wrong ?
Posted: Wed Sep 24, 2008 9:49 pm
I am trying to implement a PHP Upload Progress Bar using AJAX & iFrame technique, but not working
So I would like to ask you guys opinions about my idea.
My idea is that:
files:
Parent.php (embedded iFrame.php and includes progress.js and for showing Progress Bar)
iFrame.php (includes a html forms and handling POST action)
Progress.php (checks FILE SIZE of uploading image from upload temp dir)
When user UPLOAD a file
step 1) POST data from iFrame.php to iFrame.php and use session to store $_FILES info
step 2) iFrame.php using JavaScript to ask Parent.php to call Progress.php using Periodical AJAX (every 0.1s)
step 3) Progress.php check temp_file size and return progress to Parent.php using Json format
In above case, the Progress.php cannot read the $_SESSION["files"] properly (=null) until the whole upload progress complete.
does my idea has any mistakes ?
So I would like to ask you guys opinions about my idea.
My idea is that:
files:
Parent.php (embedded iFrame.php and includes progress.js and for showing Progress Bar)
iFrame.php (includes a html forms and handling POST action)
Progress.php (checks FILE SIZE of uploading image from upload temp dir)
When user UPLOAD a file
step 1) POST data from iFrame.php to iFrame.php and use session to store $_FILES info
Code: Select all
$_SESSION["files"] = $_FILESstep 3) Progress.php check temp_file size and return progress to Parent.php using Json format
In above case, the Progress.php cannot read the $_SESSION["files"] properly (=null) until the whole upload progress complete.
does my idea has any mistakes ?