Jump to content

uploading many files in the same time !!!


hassank1

Recommended Posts

ok let's say I've allowed a user to upload 3 files at the same time (3 file input fields in form) and then I process the form and uploaded the files..then he enters the upload form again and upload 1 single file ...so does the new uploaded file replace the 1st file in $_FILES , and the old 2 files still in the array or does array unset it's values automatically after posting ?!!

 

btw may I delete $_FILES[][] data using ( unset $_FILES ?)

 

 

File uploads are handled via taking the raw data binaries and then transferring them to a temporary folder on your server with a temporary name given to it so that when multiple files hit your server at once they don't overwrite each other.  The temp folder is purged every so often the the roving recycler on your server (usually 5-10 minutes) 

 

Generally the volume of file uploads/multiple users isn't an issue so long as you can process them on upload and not have them sit there.

 

The $_FILES array is a php super global array containing pertinent data to the files uploaded in the Last set of POST data.  If the previous page failed to send POST data $_FILES will be empty unless populated by some other source i.e cURL

if I want to accept certain files (ex: jpg , bmp , zip etc...) , is there a way to store the allowed types in an array then check if the uploaded type is in array instead of typing ex:

 

if ((($_FILES["file"]["type"] == "image/gif")

|| ($_FILES["file"]["type"] == "image/jpeg")

|| ($_FILES["file"]["type"] == "image/pjpeg"))

|| .... etc...

I was doing a simple test to figure out the mime type of (*.rar ) files ! so I've realized that it has the same mime type as an exe file !!!

 

ok well what I want to do is to allow the upload of (jpg,bmp,doc,xls,pdf etc...) well simply !! everything except *.exe files ! any suggestions?!

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.