Coder Profile - Show off your skills, get a coder profile.
 
 
 
The Author
Izzmo
Nick George
Send A Message
Rating
8.50
out of 10
( 2 Ratings )
Please login to rate source codes.

Click here to register a free account with us.
General Details
PHP (Hypertext Preprocess...
Posted 95 Days Ago
285 Views
Received 2 Ratings
More Codes By This Author
XML Reader and Writer Dem...
Uploader Class
Performance Logging with...
GD Image Verification
MD5 Hash Conversion
Articles By This Author
Embed flash into your web...
Introduction to Pseudo Co...
Command Line and Batch Fi...
Redirect your site from n...
Another way to disable th...

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 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.
 
Izzmo     Posted 89 Days Ago
 
 
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.
 
VBAssassin     Posted 89 Days Ago
 
 
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
 
Izzmo     Posted 94 Days Ago
 
 
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.
 
VBAssassin     Posted 94 Days Ago
 
 
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
 
Izzmo     Posted 95 Days Ago
 
 
You could! That's not a bad idea actually.
 
Cinjection     Posted 95 Days Ago
 
 
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?
Page 1 of 1
More "PHP (Hypertext Preprocessor)" Source Codes By This Author
Recently Posted "PHP (Hypertext Preprocessor)" Source Codes
Recently Rated "PHP (Hypertext Preprocessor)" Source Codes
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved