Pure PHP Upload 2.1 Tutorials - Restricting file size
Restricting file size
In this tutorial we will explain how to restrict the maximum size of the uploaded
files.
There are two types of file size checking:
- check on the client browser, before file is uploaded - this is done
when the files are images
- on the server, after file is uploaded - for the other file types.



How to do it
To make the file upload with restricted file size, you need to:
- Start with basic upload page
Start with an upload page where you have Pure PHP Upload on it. If
you
haven't done it yet, go through the Simple
file upload tutorial.
- Open the Pure PHP Upload dialog
Select the Pure PHP Upload dialog by opening the Server Behaviors
Panel. Select DMXzone - Pure PHP Upload.

- Select the Allowed Extensions
When you need to restrict the uploaded files to a specific size,
you need to select the Limit Upload Size To field and enter the maximum
size in KBytes.
Please note that 1024 Kbytes = 1MB
(KBytes = Kilo Bytes, MB = Mega Bytes)

In this example, we've chosen to limit the file upload size to 150 KBytes.
- Save and done
Save your page and upload it to your server, and you are done! You
shouldn't be able to upload images that are larger than 150 KBytes.


