PHP Upload Script ver. 2.31
updated: 2006-06-18
This PHP upload class (the old name) can be used to upload files with a client browser to a remote web server location. The features in the first release are: file-extension check, maximum file- size limitation and a flexible error reporting system. The class is extremely easy to use and comes together with full working examples. Since the second version is it possible to upload multiple files. Check the class file for all update information. The version 2.22 (and higher) is compatible with the PHP directive "register_globals=off". NEW functions for the multiple upload function: rename files and filename validation. With the updated (version 2.25) photo upload extension it's possible to upload photos (logos) and resize them to the maximum X and Y size. Since version 2.26 the is support for the ImageMagick command line tools as an option (works faster then functions of the GD library). Note the database example since the last version.
PHP Script Download
You need to login or register to download this class script.
Downloaded 69662 times
Last changes and updates:
Version 2.31
If someone use more then one file upload at the same time while using the rename option there was a problem with the new name. The PHP function "sleep" take care about unique filen names. I added a new method that outputs some html code which I often use if the file name is stored in a database. If there is a name defined as an argument the file field is replaced with a regular text field, note the new example file "upload_db_example.php".
Version 2.30
If the class is configured without filename validation and the file will not be renamed by the class or user, there is a problem if there are space characters in the name. I modified the method set_file_name() to take care of this.
Version 2.29
To make this class compatible for server platforms without MIME_MAGIC support there is a validation now (get_uploaded_file_info()). A user (Brad Daily) notified me about that the regex pattern inside the method check_file_name() is to hard for several extension types. The check is not so important because there is also a check for extensions against the $extensions array, it’s fixed with a new regular expression pattern.