FosAvance
FosAvance

Reputation: 2469

$_FILES["file"]["size"] in megabytes

I'm using this part of a code to get variable size while uploading

if ($_FILES["file"]["size"]<1024)
{ //do something
}

But when I upload files that are more than 1mb it shows me that file size is 0. But it works when I upload files that are in bytes or kilobytes

Upvotes: 0

Views: 421

Answers (1)

replay
replay

Reputation: 3799

Are you sure these uploads are even successful? Maybe your upload_max_filesize is 1M, so files which are bigger than 1M aren't actually uploaded. Thats why you get the 0. just guessing...

Upvotes: 2

Related Questions