As I haven't found any good exemple written for APC, I have adapted the one provided by the uploadprogress extension.

Configuration :

In the /etc/php.d/apc.ini file, enable this feature :

; RFC1867 File Upload Progress hook handler
apc.rfc1867_prefix =upload_

Download the apcupload.tgz archive.

Which contains 3 files:

  • index.php : the main script, with the form and the Ajax part which will request the server for information about the current upload
  • info.php : the script which provide the information about an upload
  • server.php : the script which process the uploaded file

Of course, this is only a "proof of concept" (and, for me, a regression test for the APC extension I'm used to run on each new RPM version).

Next : implement this, cleanly, in a real application (at random: GLPI ?).