zubrag.com
Free php and cpanel scripts to automate your daily routine

Free PHP Scripts :: File Upload Form

Simple file upload form for your site.

Features:
  • Limit file types available for upload
  • Maximum file size validation
  • Can rename file after upload to avoid URL guessing
  • Log of uploads can be saved in MySql database. Log includes Filename, file size, IP of the user, date of upload



Download File Upload Form


Comments

Michael December 5, 2007
Dude. Sweet.
Diego January 20, 2008
"Can rename file after upload to avoid URL guessing"

How do i make sure the file ending is not bigger than 10 characters? =/
m February 25, 2008
thank you very much! Very helpful!
April 22, 2008
if i wanted to upload files to "SITENAME.110mb.com"

what do i change???
i've got the username and pwd
jegonus [anti-spam] yahoo.com May 21, 2008
nope. doesn't work.
Chinmayee May 25, 2008
hey it's just working fabulous....
thank you very very much for providing this script for free...
actually it's priceless for the developers...
thanks again..
mono gram July 1, 2008
This is somthing that is rare to come accross that you share your stuff and thanks again
orsz July 13, 2008
it doesnt work for me:

405 Method Not Allowed
This type request is not allowed!
September 1, 2008
that's because you can limit specific file types
October 7, 2008
I got the dreaded 405 error and wondered what was up... then I noticed that no action is defined in the example HTML. So I changed it to the following and the 405 was gone:

<form action="file-upload.php" method="post" enctype="multipart/form-data">
designer.steiner [anti-spam] yahoo.com October 29, 2008
How do I get this uploader to send the files to "my" email account?
dipus November 20, 2008
doesn't work.. can you help? it makes nothing. no error, no upload..
Nico November 24, 2008
Yeah... It doesn't work!
LM4041 November 30, 2008
The original HTML file does not work (No reference to the PHP uploader file.

Correct as follows:
Original
<form method="post" enctype="multipart/form-data">

Updated
<form enctype="multipart/form-data" action="file-upload.php" method="POST">
December 10, 2008
It didn't work for me at first. After messing with it I figured out that the user has to load the php file first. Not the HTML.
kyle March 27, 2009
I get this error when trying to use the script, i've changed the folder permissions, but now im stuck, any ideas??
kyle March 27, 2009
The server encountered an unexpected condition which prevented it from fulfilling the request.
The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log.
JP April 2, 2009
Very nice script. Works like a charm :)

I have one questions, is it possible to add a function that resizes the image to a predefined width and/or height, but respecting aspect ratio?

I'm a php n00b and _tried_ to solve this but nothing works. Did any of you get that to work?
david [anti-spam] aquafields.com April 11, 2009
It Goes! Thanks!
I've tried for many hours to replicate PHPForms that worked on many of my sites but never on the one it was needed most! This worked instantly.
mjlomenzo [anti-spam] mountainside.org April 14, 2009
Destination folder does not exist or no permissions to see it.... what do I do here?
mjlomenzo [anti-spam] mountainside.org April 14, 2009
PS I even tried setting the permissions to 777
snkhwazi [anti-spam] yahoo.co.uk April 16, 2009
It works brilliantly, tryna amend it to make multiple file uploads!!!
PrimiCaps April 21, 2009
hello. this script is very useful. :) although, I wanna know if can we call for the uploaded file's name after it was uploaded??
April 23, 2009
You request the php file not the html file. Look at the script again. the script calls the html fille
dayne April 24, 2009
hehehe
cathy [anti-spam] spiderbytes.co.za May 19, 2009
I would like to know what variable I need to upload to the databse in order to call for the image. Can anyone help me?
nareshkumar_R [anti-spam] spanservices.com July 31, 2009
hi ra, pls download this file
Ajibolaolayanju [anti-spam] ymail.com September 9, 2009
I does it works i mean the upload php
September 15, 2009
It works perfectly. Although it'd be great to have a progress bar. Useful for large files and impatient clients
nickweb [anti-spam] otenet.gr September 29, 2009
Please enter (f78c1b3a) into the box
nxnx October 2, 2009
thanx..
but
how to rename the filename.
rudiwidayatna [anti-spam] ymail.com October 6, 2009
Thanks....
but how can i do to use this files in blogger? and where is the files upload by user is storage...?
October 21, 2009
thank you so much for your php script, really helps.
October 21, 2009
jo
thanks a lot
dominik October 30, 2009
i ryl like it
is there a version with a upload-funktion?
Thanks....<br> November 25, 2009
Thanks........<br>
nitin December 11, 2009
i am getting the message could not upload file (6) what could be the reason for this
Cobalt-Phoenix December 20, 2009
Hey, great script! I did notice that the files renamed themselves to random characters. If anyone is interested, to fix this, simply take out the line where it says

if (RENAME_FILE) {
$dest_filename = md5(uniqid(rand(), true)) . '.' . $file_ext;
}

However, keep this intact.

$dest_filename = $filename;

This will keep the original filename without the random rename.
I don't know about anyone else, but I tend to be picky about filenames. :p

Thank you for providing this script! It's very useful!
RiffThirteen January 13, 2010
Worked perfectly. But what do I need to change if I want to submit information about the image into the database?
nancy January 30, 2010
nice script. didn't work in windows xp till i gave it the full path c:/... (not \) and it worked like a charm.Also load the php file and not just double click on the html
thanks
Mazhar February 3, 2010
Hi Friends,

When i Upload the file by click Upload Button then it saves file-Upload.php file rahter then i select any other file(like Doc,txt etc.). Can Anyone give me idea to save the file which i have selected from filedialog.
ndiane2002 [anti-spam] hotmail.com February 13, 2010
Hi friends,

I am new in webdisign (using dreamwever), I have downloaded a upload script but don't know how to put it on my web site.

could anyone tell me how to do this?

thanks in advance
k
jessicajonnie [anti-spam] gmail.com February 24, 2010
Great script! How do I get it to email an alert notification upon sucessful upload?
March 2, 2010
GREAT SCRIPT!
I am sending the file info to MySql database, renaming the file and I have it set up to email the info on submit but I cant figure out how to receive the renamed file name instead of the original file name. Thanks in advance for any help. ET
vama97 [anti-spam] yahoo.com March 11, 2010
Can anyone tell me how do I get it to my email ?

Add Comment

!!! Comments posted here will not be answered. If you want to ask a question please post it on the forum.

E-mail or Name: Not required. Email will be protected from spammers

Comment: Please do not post unrelated comments

Anti-spam: Please enter (89ceb8a8) into the box