0

I have a file input with multiple attribute

I want when user select multiple file in this control split those files and create multiple file input with each one having only one of those files selected.

This allow a user to select multiple files at once but delete them individually if he wants.

Beside i want to ajax upload those files one by one while allowing user to cancel any of those file being uploaded.

any idea.

1
  • I don't think you'd be able to populate a file upload like that - seems like a security risk. But why would you want to? Server-side code can handle multiple selections fine. Commented Sep 15, 2014 at 8:17

2 Answers 2

1

You can use one of the free jQuery plugins available.

jQuery File Upload Demo

Uplodify

Sign up to request clarification or add additional context in comments.

Comments

0

You cannot set the "files" or "value" attribute on a file input - therefore you can't just create new file inputs and fill them with one file each. But you can use the new HTML5 FormData object to upload each file separately. So you just display the original file input's "files" attribute as a list. The user can de-select the indices. When he submits you can iterate the files attribute and skip the de-selected indices. See https://stackoverflow.com/a/24089581/4809444

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.