Hi all,
Hi have created a script for file upload upto 10mb.
I need to show progress bar for it using ajax.
Please give me some idea or an example script
Upload Progress Bar
Moderator: General Moderators
Re: Upload Progress Bar
php is server side which means everything stops untill the file is uploaded therefore there is no way to detect the progress
Re: Upload Progress Bar
He asked about AJAX though. There are some scripts available out there that do this. A simple Google search brings up plenty of results that match your needs.
Re: Upload Progress Bar
You can use ACP to do this (PHP 5.2+)
Tracking file upload progress
Tracking file upload progress
Re: Upload Progress Bar
ahhh nice, i had no idea this could be done
Re: Upload Progress Bar
Actually there was a couple of ways to do this before PHP 5.2jazz090 wrote:ahhh nice, i had no idea this could be done
The problem is not in server side, the problem is that PHP gives control to your script after the file is uploaded (which I think is done to simplify the file processing, directly using the $_FILES variable)
And you can always call another script, using AJAX, to tell you the progress, because you are not uploading a file to it, hence it is called before the file upload ended. But it have no idea what file is the one being uploaded. Here comes the ACP. Before it, you can either use Perl script to process the upload, or use a third party PHP extension, which is not suitable for shared hosting
And by the way, keep in mind:
There are no impossible dreams