Important alert: (current site time 7/15/2013 11:20:37 AM EDT)
 

winzip icon

phpSimpleUpload

Email
Submitted on: 3/1/2003 12:47:41 PM
By: spyral_productions 
Level: Beginner
User Rating: By 15 Users
Compatibility: PHP 4.0
Views: 16839
author picture
(About the author)
 
     A 'simple' upload script made for developers to easily and efficiently upload mass files. Easy to implement into your own site. -- (UPDATED: June 12,2004) - New updates as of this date include setting number of upload slots, the code has been re-vamped and the HTML has been cleaned as per user requests. All comments in code no READ ME file anymore. -- (UPDATED: May 13,2004) - Added some more information to the READ ME file and edited some features in code. -- NOTE: If you use this code please tell me WHERE you are using it. Im interested to know what my code is being implemeneted into, thanks.

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
// for :phpSimpleUpload
//**************************************
This code is totally open. I don't expect anyone to put my name on their website or to advertise anything. Use my code as much as you want but give me a good score ;-) and notify me as to where you use it. I would be interested to know where it is being implemented.
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
3/4/2003 8:17:22 AM

finally someone has decided to offer a great simple code. i have noticed that it's not woring to well on my Apache system, but perfectly on iis. does anyone know why?!?!
(If this comment was disrespectful, please report it.)

 
3/4/2003 10:54:26 PMlenfocenter.com

What exactly do you mean by "not working too well"? I tried it on my Apache server and it seems to freeze and no files that were selected are uploaded.
(If this comment was disrespectful, please report it.)

 
3/6/2003 6:07:07 PMDave Di Biase

It...freezes...?? I had about 6 people e-mail about this problem and most of the problems were because they were selecting the wrong folder to copy to OR their Apache/IIS were setup incorrectly.

So check it over see what you get.
(If this comment was disrespectful, please report it.)

 
3/9/2003 11:43:41 AMRichard Taylor

Works fine with my Apache 1.3, nice one, thanks :)
(If this comment was disrespectful, please report it.)

 
3/10/2003 5:57:47 PM

Trying to run it on a e-smith box. It doesn't seem to work. Do I need to set appropriate rights to the folder I am copying to? It looks nice but I would like it work. Help!
(If this comment was disrespectful, please report it.)

 
3/13/2003 4:14:26 PM

I cannot get this to upload to another directory. I followed the instructions, but when I added
(If this comment was disrespectful, please report it.)

 
3/13/2003 4:16:15 PM

I cannot get this to upload to another directory. I followed the instructions, but when I added "/place_to_upload/" it freezes. When I drop-off the first "/", it loads, but does not upload. I have set the permissions to "777" and still no go.
(If this comment was disrespectful, please report it.)

 
3/13/2003 4:18:03 PM

Is there another way to specify which directory to upload to?

Thanks.
(If this comment was disrespectful, please report it.)

 
3/15/2003 5:40:45 PM

I figured it out. Here are my additions:

First I added:

$conf["download_folder"] = "/other_directory/";

Then I added it to:

$conf["download_folder"].$_FILES['upload'.$num]['name']

Works like a charm.

(If this comment was disrespectful, please report it.)

 
4/15/2003 2:37:15 PMDave Di Biase

Oops. I forgot to update this script -_-

Tehehe. Yeh you have to keep the file name in the directory. Sorry thats all I needed to say :-p
(If this comment was disrespectful, please report it.)

 
8/11/2003 5:36:53 AM

Hmmm nice code. Congrats on winning the award. Your code is compressed, well written and easy to implement. You should really think about editing some of the HTML. Thats the only nasty part.
(If this comment was disrespectful, please report it.)

 
8/12/2003 10:14:57 PMDaniel Smith

Excellent work, thanks for the example. Also one thing, when you point out how to make it copy to another dir, you have to put the dir in quotes and concatinate, or it won't work.
(If this comment was disrespectful, please report it.)

 
9/8/2003 10:18:56 AMGary Crowhurst

good job well worth 5 globes :)
(If this comment was disrespectful, please report it.)

 
11/26/2003 5:39:32 PM

Great script, helped me a lot. The only problem was moving the directory with the way you specified, but that was easily fixed by supplementing another variable. 5 stars! *****
(If this comment was disrespectful, please report it.)

 
9/11/2004 1:24:49 PMMel Christian Maranan

Best upload script on psc!! ill give you ten if ther is ten..
(If this comment was disrespectful, please report it.)

 
11/30/2004 7:54:42 AM

How can I change de max_size? I changed to $max_size=5000000000 and not work. Can you help me what is wrong?
(If this comment was disrespectful, please report it.)

 
10/14/2005 12:44:47 AMmatt macnish

great upload tool heres a string to convert the size to a smaller number, replace the output to $hii

$hii = $_FILES['upload'.$count.]['size'];
$hii = $hii / 1000000;
if($hii > 1){
$hii = round($hii, 2);
$hii = $hii . " MB";}

if($hii < 1){
$hii = $hii * 1000;
$hii = round($hii, 2);
$hii = $hii . " KB";}
(If this comment was disrespectful, please report it.)

 
1/18/2006 10:13:06 PMBlues Keyrocks

Dave- a very slick utility indeed. Clean and simple, and easy to enhance the user interface by adding a new template. One suggestion - add another variable: $filename = "upload"; and replaced all occurences of "upload.php" with "".$filename.".php"

This way, if a user already has an upload.php file in his site's files for something else, he/she can change the name of the file, then make the change in the variable and the file will function fine.
(If this comment was disrespectful, please report it.)

 
5/4/2006 5:53:36 AMjosephine

halo..may i noe how to display all the upload file to user to let them download??
i need it in urgent....
(If this comment was disrespectful, please report it.)

 
5/23/2006 3:43:14 AMChristopher Alviar

WOW, thanks for the code.. very nice and it really works!!
(If this comment was disrespectful, please report it.)

 
3/7/2007 12:33:18 PMfi

So Simple Code.. Great! easy to use and just add to database. Walaaa.. You deserve became a winner :)
(If this comment was disrespectful, please report it.)

 
3/21/2007 3:51:02 AMRomka

Hi, I have trying to display the x & y (width and height for the uploaded file but, I can't seem to figure it out... Please some help me... ?
(If this comment was disrespectful, please report it.)

 
3/31/2013 1:21:29 PMsam

Hi im having trouble with uploading, is there a mysql table to go with it? Im new to php so my understading isnt very great, thanks
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.