PHP Classes

Upload Progress: Track file upload progress

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (5 months ago) RSS 2.0 feedNot enough user ratingsTotal: 718 All time: 4,613 This week: 71Up
Version License PHP version Categories
upload-progress 0.1.0GNU General Publi...5.2HTTP, PHP 5, Files and Folders


This class can be used to track file upload progress.

It can generate an identifier to track that the file upload that should be used in the HTML form as a hidden field.

When the upload form is submitted, PHP can associate the file being uploaded with the generated identifier, so the class can retrieve information of the upload progress in a parallel HTTP request eventually sent via AJAX.

The class uses the PHP upload progress extension which can be configured to keep track of the upload progress using an APC cache entry, PHP session variables or PHP temporary files.

Picture of AlexanderC
  Performance   Level  
Name: AlexanderC is available for providing paid consulting. Contact AlexanderC .
Classes: 13 packages by
Country: Moldova Moldova
Age: 34
All time rank: 7311 in Moldova Moldova
Week rank: 77 Up1 in Moldova Moldova Equal
Innovation award
Innovation award
Nominee: 3x


Why? Basicaly because of crossbrowser compatibility. In fact it is supported by any* browser. How to use? $p = new FileUploadProgress("unique_file_description"); // ... insert in upload form before file field echo $p->getHiddenUploadFieldHTML(); // and now get upload progress info $arrayWithThings = $p->getProgress(); // this will throw an exception if no/wrong data Please note!!! File upload track should be done using ajax or frames, php script with file data(from $_FILES) will be available after upload only, and this class make no sense if used in that script. What to install before to get it working? - To enable upload track support install and configure apc: apc.rfc1867 = 1 - Or to install uploadprogress PHP extension - Or to install PHP 5.4< and set: session.upload_progress.enabled = 1 ;set by default here

  Files folder image Files  
File Role Description
Plain text file FileUploadProgress.php Class Class source
Accessible without login Plain text file Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,613
This week:71Up