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 1.67 Year Ago
515 Views
Received 2 Ratings
More Codes By This Author
Basic Calculator
Portable Contact Form v2
[PHP] Shopping Cart Class...
Pascal's Triangle with Bi...
Bill Change
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 1.65 Year 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 1.65 Year 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 1.67 Year 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 1.67 Year 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 1.67 Year Ago
 
 
You could! That's not a bad idea actually.
 
Cinjection     Posted 1.67 Year 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
 
 
Latest News About Coder Profile
Coder Profile Poll
Which sounds better on your coder profiles, and makes more sense to you (think twitter, facebook, etc)?

Followers / Following
Fans / Following
Fans / Fan Of


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
1.28 Year Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2010, Scott Thompson, All Rights Reserved