Code snippets, tech tricks and other bits and bobs

PHP File Upload Progress Bar

A pure PHP based (I.E. not Flash or Java based) method of monitoring file upload progress used to be something of a holy grail for web designers for some time, especially for people creating CMS or otherwise handling user provided content. I remember seeing mention of it being on the horizon many, many moons ago, but hadn't looked into it for a long time. Implementations in the CMS I have used is still very rare - where there is any it is still often Flash.

Installing APC recently, I noted the apc.rfc1867 configuration directive which states:

RFC1867 File Upload Progress hook handler is only available if APC was compiled against PHP 5.2.0 or later.

Aha, so that's the key is it? Time to investigate again methinks.

I shall at some point be taking a look at

http://www.johnboy.com/blog/a-useful-php-file-upload-progress-meter

and

http://www.johnboy.com/php-upload-progress-bar/

The second is his more recent implementation. At first glance it appears to use an iFrame - well, this is the ajax age, so I hardly think that should be an issue to bring bang up to date.

I shalll be returning to this!

Filed under  //   APC   File uploads   PHP