Gargron / fileupload

PHP FileUpload library that supports chunked uploads
MIT License
460 stars 87 forks source link

Multiple upload #60

Closed iyasilias closed 6 years ago

iyasilias commented 6 years ago

I've seen closed issue with the same title, but it seems no one have problems uploading multiple files.

I'm pretty sure HTML doesn't require a name with []such as files[] in this sample code<input class="form-control" type="file" name="files[]" value="" multiple/> if we want to upload multiple files.

Just to point out that there is no where in your docs stating the need for an [].

Great library though. Thumbs up!

iyasilias commented 6 years ago

Additional question, how do I name my file based on files count? Like note1.pdf, note2.pdf if 2 pdf files uploaded?

adelowo commented 6 years ago

This cannot be done by the library currently.. A method you can use to do this is to use the completed callback.. Basically, you rename the files .

Another method you can for this (although kind of a hack) is to create a custom name generator class that has state. The generator should have a counter property that denotes the number of uploaded files, then you just append the counter value to the filename.