1. Computing

Uploading Files with PHP

By , About.com Guide

3 of 6

Limit the File Size
 if ($uploaded_size > 350000)
 {
 echo "Your file is too large.<br>"; 
 $ok=0;
 } 
Assuming that you didn't change the form field in our HTML form (so it is still named uploaded), this will check to see the size of the file. If the file is larger than 350k, they are given a file too large error, and we set $ok to equal 0.

You can change this line to be a larger or smaller size if you wish by changing 350000 to a different number. Or if you don't care about file size, just leave these lines out.

Related Video
Upload Videos to YouTube
Upload Videos to Google Video
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Advanced PHP
  5. PHP File Upload - PHP Upload Script - Upload file script

©2013 About.com. All rights reserved.