PHP Classes
elePHPant
Icontem

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
2012-10-15 (3 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 670 This week: 1All time: 4,568 This week: 1,091Up
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: 26
All time rank: 7541 in Moldova Moldova
Week rank: 339 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  
File Role Description
Plain text file FileUploadProgress.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:670
This week:1
All time:4,568
This week:1,091Up