i could get the size of the file i uploaded, however, i want to convert it to MB, i dont want to make some computations, is there any easy way to do that????

Recommended Answers

All 2 Replies

The only way you can do that is with computations, rest easy though, the computer takes care of the actual math for you:

$bytes = $_FILES['my_file']['size']; //Size of file in bytes
$kbytes = $bytes / 1024;
$mbytes = $kbytes / 1024; //Size in Mega bytes

Nice and simple :)

hi sir, i got it already...thanks thanks...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.