Jump to content

[SOLVED] array_sum on multiple file upload


c_shelswell

Recommended Posts

Hi I'm just trying to make a simple 6 file upload. Is it possible to do an array_sum on the file size below to determine if the user is uploading too much?

 

eg array_sum($_FILES['size']);

 

Array ( [photo1] => Array ( [name] => bucket.jpg [type] => image/jpeg [tmp_name] => C:\Windows\Temp\php543F.tmp [error] => 0 [size] => 308989 ) [photo2] => Array ( [name] => Haddock.gif [type] => image/gif [tmp_name] => C:\Windows\Temp\php544F.tmp [error] => 0 [size] => 46677 ) [photo3] => Array ( [name] => forest.jpg [type] => image/jpeg [tmp_name] => C:\Windows\Temp\php5450.tmp [error] => 0 [size] => 118882 ) [photo4] => Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 ) [photo5] => Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 ) [photo6] => Array ( [name] => [type] => [tmp_name] => [error] => 4 [size] => 0 ) ) 

 

cheers

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.