0

I've the following code to upload a temp file within the server. I would like to check the file size. If the file is larger than 25MB I would like to abort the proces. If the file size is less than 25MB I would like to proceed with the upload.

   $tmp_name = $_FILES['filename']['tmp_name'];
   $type = $_FILES['filename']['type'];
   $file_name = $_FILES['filename']['name'];
   $size = $_FILES['filename']['size'];

Anyone a suggestion? Tnx for any reply.

1 Answers1

0

You could use something such as:

if($_FILES['file']['size'] > 26214400) { 
        echo "File too large. Uploaded files can be no more than 25MB.";
    } else {
... let them upload ...
l'L'l
  • 44,951
  • 10
  • 95
  • 146