<form action = "uploadFile.php" method= "POST"  enctype = "multipart/form-data">
      <input type = "file" name = "file[]"><br><br>
      <input type = "file" name = "file[]"><br><br>
      <input type = "submit" value = "Submit">
</form>


Is it possible to upload more than one file at the same time with just a click on the submit button?
I am having this problem of figuring out what to do as to uploading multiple files at the same time? Any idea please?

Recommended Answers

All 2 Replies

The code you have there will upload 2 files. The resultng array %_FILES['files'] that is posted will contain them both.
What exactly are you having trouble with?
Something to remember is that PHP has a config setting MAX_FILE_UPLOADS (since PHP 5.2 I think) that specifies the maximum number of files can be uploaded in one go.

I initially had the issue, or problem of choosing how to go about uploading the respective files! I first thought that maybe I should upload them individually, but I have already resolved how to go about it. Uploading all the files at a go will be better and then capturing the error for any failed file was the final means I employed.

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.