PHP Classes

Upload Progress: Track file upload progress

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

Author

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: 35
All time rank: 7301 in Moldova Moldova
Week rank: 128 Up1 in Moldova Moldova Equal
Innovation award
Innovation award
Nominee: 3x

Details

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 (2)  
File Role Description
Plain text file FileUploadProgress.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:719
This week:0
All time:4,611
This week:61Up