Asynchronous file upload with AJAX progress bar in PHP
Tomas Larsson over at tomas.epineer.se has posted a tutorial on uploading files with PHP and showing the progress with Ajax. This is a relatively short and easy tutorial and adds that little extra to your uploading forms.
One of the few things that I find lacking in PHP is the ability to report the progress of a file upload. This means that file uploads, especially uploads of larger files, can be extremely frustrating for end users when they don’t know if the upload is progressing or if it has stalled or if it has even started. There are two ways around this. One is to patch PHP, Pdoru provides such a patch. Not everyone can patch PHP though. You can’t use a patch if you’re on a shared server, if you want to use ready-made binaries, if you don’t want to risk stability by using a patch or if you just don’t want to have to remember to apply the patch again every time you upgrade PHP. The other option is to use a perl script to receive the file when it’s uploaded. This is the approach used by MegaUpload. MegaUpload is what I have based my solution on, but I have added asynchronous file upload support and an AJAX upload progress bar, instead of the refreshing popup used by MegaUpload.
About this entry
You’re currently reading “Asynchronous file upload with AJAX progress bar in PHP,” an entry on Ajax Lessons

- 3.13.06 / 10am

4 Comments
Jump to comment form | comments rss [?] | trackback uri [?]