Frage

This I believe is a PHP issue, but please feel free to chime in. I am trying to upload a file, I have set the max size to 10240 (10mb's). I am trying to upload a file, (in Ubuntu 13.04) from the desktop to my localhost site. This file size is 18.9kb's its a zip. I have checked the size 50 times.

I var_dump the file coming in: $_FILES['file']['size'] to check the size as it's spazzing out through a custom error stating "this file exceeds the allowed size of 10mb's."

The size dumped? 18888 thats roughly 18mb's

Oo.

That's not right, the file I am uploading is 18.9kb's

Is there something I should be looking for? Im not sure how to fix this. I am running PHP 5.4.latest

War es hilfreich?

Lösung

If you just used the integer 10240 for upload_max_filesize, then it's measured in bytes, so your limit is 10KB, not 10MB

Also be aware that you need to ensure post_max_size is at least as large as this too, and see this manual page for other pitfalls (thanks zsawyer).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top