PHP progress bar (file upload)

Associate
Joined
23 Mar 2005
Posts
969
Location
Colchester, Essex
Ok so, for god knows what reason I've decided to code a website in php.

Successfully streaming the file into a db fine no problems there.

What would be lovely though, would be a nice progress bar as the file is uploaded. I've found plenty of examples doing this using perl, but most of these examples are for writing the file to the file structure of the host. I'd like the file shoved in the db.

The only way I can think of at the moment is to upload the file to a temp location on the file system, then copy that into the db. This seams a bit long winded though.

Any thoughts?
 
That's pretty much how you have to do it, as PHPs file upload handling will do that for you anyway. There's a method of doing a progress bar for the upload, but it requires patching PHP first. The other alternative is to do the upload with a perl script, then hand the file over to your PHP script after the upload, but that's very messy.

http://pdoru.from.ro/upload-progress-meter/ for the patch.
 
Back
Top Bottom