Monthly Archives: February 2007

PHP 5.2 and Upload Progress Monitor

In PHP 5.2.0 (and newer) version there is a new feature labeled as:

“Added RFC1867 fileupload processing hook. (Stefan E.)”

in changelog; browsing other documents they refer as “allow the developers to create progress monitors (for AJAX) without patch PHP”.

The normal way to see a progress bar was patching your PHP, but first I though there was some functions added to PHP, this is not the case; PHP defines now a callback (hook) for any new module that wans to implement this code; you need to compile either:

APC (haven’t tested) or
PECL UploadProgress

You can see some examples and code here:
http://www.whenpenguinsattack.com/2006/12/12/how-to-create-a-php-upload-progress-meter/ (for APC)
http://blog.joshuaeichorn.com/archives/2005/05/01/ajax-file-upload-progress/ (for UploadProgress, good php code but not HTML code, please check the comments to see how write your HTML).

And restart your apache server; the fact is that under dotdeb and debian etch I wasn’t able to get work this, I even modify a bit the code of uploadprogress to write a file when the module was inited and when was called for updating the progress of the upload.
The init was ok, but updating was never done.

My solution? Just recompile PHP 5.2.1 (the same version dotdeb and debian etch was providing me), I’m not aware why that versions doesn’t work under dotdeb and debian etch.

Share

Yellow Curtains

Yellow Curtains by danguer

Testing colors and light.

Link: http://www.flickr.com/photos/danguer/383247978/

Share