|
General Details
|
|
PHP (Hypertext Preprocess...
|
|
Posted 95 Days Ago
|
|
285 Views
|
|
Received 2 Ratings
|
|
Uploader Class
Description
This is a simple PHP Uploader class that is very portable and customizable. Download the ZIP file for usage instructions.
Technical
All you need to run this is PHP 5 and knowledge of classes and their usage.
Source Code
|
Download Source Code
desktop.zip ( 0.00Mb )
|
NEVER open a .exe, .bat, .cmd, or other executable file since that is where viruses are likely to live. Please virus scan all files you download.
|
Comments
| Please login to post comments. |
|
|
Well true, in a sense. But by limiting the extensions and MIME types, then you will get out the idiot people who think they can upload anything.
|
|
|
It's only insecure if the person does not store the files properly. For example... on the discussion forum i allow all types of files to be attached, the same for PM's... but you will notice that all files when downloaded are fed through a php script for download... which is because the files are saved above the server root directory that the public can access ;-)
But... thats nothing to do with the uploader class itself in regards to security... so i think you should allow it. For security concerns, they could just put in .exe, .py, .pif, .php etc and allow bad extensions anyway :-P
Kind regards,
Scott
|
|
|
Well, it's using FTP upload, not the default PHP methods. It's still using the HTML form to upload the file though. I just didn't include that in the usage because it's a bit repetitive.
Also, using an 'all' feature is very insecure, thus I decided not to include it.
|
|
|
Seems strange seeing an FTP one, the many uploading classes and functions i've written over the years have been for html forms.
Anyway, just a tip... setAllowedFileTypes($array)
Allow $array to be:
$array = 'all'
OR
$array = array('exe', 'php', 'zip');
Because it would be hard work using your class for say a file repository when they can't specify the thousands of types a file could be ;-)
Next task, extend it to use an GUI interface ;-)
Kind regards,
Scott
|
|
|
You could! That's not a bad idea actually.
|
|
|
Hmm, I'm not a PHP expert, but couldn't you make those customizations parameters to the constructor? Namely, $allowed_file_types, $upload_dir , $max_file_size. Wouldn't that make it more portable and easier to use?
|
More "PHP (Hypertext Preprocessor)" Source Codes By This Author
Recently Posted "PHP (Hypertext Preprocessor)" Source Codes
Recently Rated "PHP (Hypertext Preprocessor)" Source Codes
|