In one of my web projects the user has the option to upload XML file. In some cases the XML file could link to XSD files, which means that the XSD files have to be uploaded too. But the web browsers (as far as I know) give access only to the selected in the file chooser files so I can't automatically upload the needed files (if they are not selected).

What is the best practice to handle this situation when the multiple file selection is obligatory, but the technology (I mean the browser) can't be configured?

  • DoNot, as far as I know you can upload several files at the same time. What do you mean: browsers give access only to the selected upload files? You mean after the upload?
    – Alvaro
    Nov 11, 2016 at 10:42
  • @Alvaro, I mean that the web application can access only the files selected in the file chooser
    – DoNot
    Nov 11, 2016 at 11:14
  • Does the user know if his XML has a XSD associated?
    – Alvaro
    Nov 11, 2016 at 12:01
  • That's one the problems. I can't be sure that the user is aware of the dependencies so I have to ensure that all needed files will be uploaded. In addition I don't want to make it complicated.
    – DoNot
    Nov 11, 2016 at 13:11

3 Answers 3


This is an unusual problem and, as such, I'm not sure if there is an precedent for these behaviours.

Automatic uploading of the files would be great in this case but it also comes with the concept that the app is uploading files without the user's express permission.

I would suggest that after the initial XML is uploaded, it could be parsed to see if other files are required. if other files are required, you then present the user with the option of uploading the other files with a dialogue - Something like "The file you uploaded requires other files to function correctly. [list of detected file dependencies] Do you wish to upload these now?"

  • Thank you. I think that would be the solution, because there is no other way to validate the XML and its linked files. First they should be loaded and parsed after that it can be determined if the files are valid.
    – DoNot
    Nov 11, 2016 at 13:17

Within the browser you can upload several files at the same time, and you can also limit the number of files uploaded. (I took a quick Google search and found this .js plugin)

These are the scenarios I can think of:

One file upload (either you limit the uploads to just one, or the limit is higher and the user just uploads one):

  • Original: Might need to upload dependency; needs confirmation
  • Dependency: Needs to upload original; needs confirmation

Two files upload:

  • Original + Dependency: Needs confirmation

  • Original + Dependency (one or both are wrong files): Needs warning (specific, depending of the different cases); needs a second step; needs confirmation

As it can get complex for both the user and you I would suggest breaking the process in steps.

First let the user upload one file. Just the original. Then ask the user if this file has an associated dependency and let him upload if so.


You could perhaps use some kind of Dropbox app/ftp app in which you sync an entire folder and subfolder where all the files were located. I'm guessing that this is also possible with the use of Java (not Javascript) inside a browser.

When I used Dreamweaver you created an project that scanned through all the html-documents and css-files and asked if you wanted to upload linked files such as images, scripts etc. This was all done locally.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.