2

HTML5 does not allow directory upload.

But inevitably, some users will end up uploading a folder, because they don't know about HTML5 rules. The uploaded folder is just a small file.

How should I handle those cases?

  • Should I pretend the user really wanted to upload this small (probably meaningless) file?
  • Should I try to check if uploaded file is actually a folder, and warn the user if it is? (the actual data of a folder file is different on every OS, so not that easy)
  • Is it the browser's fault, should Chrome prevent the user from HTML5-uploading a folder?

Note: Alfresco uses the first strategy. If you know any application that uses the second strategy I would be glad to hear about it.

Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
  • Different but related: http://stackoverflow.com/questions/3590058/does-html5-allow-drag-drop-upload-of-folders-or-a-folder-tree – Nicolas Raoul Jun 12 '12 at 04:23

1 Answers1

1

Alfresco has recently changed their strategy to the second strategy.

If the uploaded item is a folder or has a null size, it is refused server-side, and the Web UI tells the user.

I guess it is the best thing to do for now.

Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373