You need to
before you can comment on or make changes to this bug.
It's currently possible to drag a directory onto a <input type="file"> control. It's not possible to pick one from the file picker.
If we're going to support dragging directories onto a file control we need to do something intelligent (like auto-zipping the directory on submission).
If we don't want to support dragging directories onto file controls, we need a good UI for when we prevent it (like showing the "can't drop" cursor during the drag).
If a drag has both files and directories in it, we should treat it the same as if it just has a directory, I think. Either way we need to handle this case.
Currently when you try to submit a directory, we do the following:
Safari can’t open the page.
Safari can’t open the page “https://bugs.webkit.org/attachment.cgi”. The error is: “Operation could not be completed. Is a directory” (NSPOSIXErrorDomain:21) Please choose Safari > Report Bugs to Apple, note the error number, and describe what you did before you saw this message.
Instead we should throw a JS exception on form.submit() or something (or maybe we already do, I clicked the "submit" button manually).
I can break this into multiple bugs as needed.
Three tests for directory dragging are being added in editing/pasteboard/file-input-files-access.html as part of bug 25852.
Looks like the zipping behavior is intended!
Zipping behavior is client defined, it seems. I guess the current Safari client only choses to zip bundles, leaving CF Network to fail when trying to send directories.
This bug is about that we should *refuse* the drag if we can't handle them. Or handle the directories properly if we accept the drag. Anything else is confusing to the user.
Changing title to "WebKit should either handle directory uploads or refuse directory drags"
currently we both accept the drag and fail the upload, see the above mentioned CFNetwork error message.