4

I am using HTML5's multiple file upload feature.

I am wondering if:

  • Can you limit the number of file a user can select?
  • Can you get the order in which they were selected?

I am making a page where it lists screenshots from users. I would like to tell them that the the first image they select in the dialog box, will be the main image displayed on the index page.

However, the dialog window seems to return the selected files in alphabetical order(actually, not sure if HTML5 is doing this, or PHP).

1
  • you will have to use something else to tell you which image they want as main. Commented Jun 10, 2011 at 6:59

1 Answer 1

4

I don't believe you can set a limit to the number of files with a built-in attribute, just multiple or not, like: <input type="file" multiple="true">

You could use javascript on the front-end to limit the number and verify on the server.

I would guess the files are listed in alphabetical order, the exact order is probably system-dependent.

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

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.