Login   Register  
PHP Classes

PHP Upload Picture: Validate and resize an uploaded image file

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-02-22 (10 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 738 All time: 4,163 This week: 1,325Up
Version License PHP version Categories  
upload-picture 1.0BSD License5.3PHP 5, Graphics, Files and Folders, V...
Description Author  

This class can validate and resize an uploaded image file.

It takes an array entry from the $_FILES array for a given uploaded file and checks if it has one of the allowed file name extensions, checks if it as one of the allowed MIME types, and checks if the file size does not exceed the limit size.

Valid picture images may be moved to a given directory with the original name or a given new name.

The class may also rescale the image to fit a given width and height preserving the original picture proportions.

The class may also save the picture in JPEG format with a given compression level.

The class throws exceptions for any validation or processing errors.

Picture of catalin
Name: catalin <contact>
Classes: 6 packages by
Country: Romania Romania
Age: 34
All time rank: 107926 in Romania Romania
Week rank: 757 Up20 in Romania Romania Up

  Files folder image Files  
File Role Description
Accessible without login Plain text file index.php Aux. Example html file for upload
Accessible without login Plain text file README.md Data Short description
Accessible without login Plain text file uploadFile.php Example Example file: how to use
Plain text file UploadPicture.php Class Main class file

 Version Control Unique User Downloads Download Rankings  
 100%Total:738All time:4,163
 This week:0This week:1,325Up