You are here:About>Computing & Technology>PHP / MySQL> Advanced PHP> PHP File Upload - PHP Upload Script - Upload file script
About.comPHP / MySQL
Newsletters & RSSEmail to a friendSubmit to Digg

Uploading Files with PHP

From Angela Bradley,
Your Guide to PHP / MySQL.
FREE Newsletter. Sign Up Now!

The HTML Form

This script will allow you to upload files from your browser to your hosting, using PHP. The first thing we need to do is create an HTML form that allows people to choose the file they want to upload.
<form enctype="multipart/form-data" action="upload.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>
This form sends data to the file "upload.php", which is what we will be creating next to actually upload the file.
  1. The HTML Form
  2. Uploading the File
  3. Limit the File Size
  4. Limit Files by Type
  5. Putting It Together
  6. Final Thoughts

Previous | Next >>

 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.