directory-upload

Allow chrome to select both/either directory or files

做~自己de王妃 提交于 2019-12-11 12:06:00
问题 If I insert <input type="file" name="files" webkitdirectory> in a html file, chrome will allow you to select directories, however not files. If I then remove the webkitdirectory ( <input type="file" name="files"> ) then it will only let you choose files. How do I allow it to choose both/either files and/or directories? 回答1: This is a bug I filed a while back. 来源: https://stackoverflow.com/questions/8041022/allow-chrome-to-select-both-either-directory-or-files

How can I filter out directories from upload handler in Firefox?

 ̄綄美尐妖づ 提交于 2019-12-01 20:10:55
问题 Problem I have following code snippet that is used to get file information during file drag and drop upload: var files = event.dataTransfer.files; for (var i = 0; i < files.length; i++) { var file = files[i]; // I need notDirectory(file) function. notDirectory(file).then(function(file) { output.innerHTML += `<p> Name: ${file.name}</br> Size: ${file.size} bytes</br> Type: ${file.type}</br> Modified Date: ${file.lastModifiedDate} </p>`; }); } I did research and found that Firefox does not

Django directory upload get sub-directory names

梦想与她 提交于 2019-11-30 19:43:26
I am writing a django app to upload a directory of files with forms. This is the form I am using which allows upload of directory: class FileFieldForm(forms.Form): file_field = forms.FileField(widget=forms.ClearableFileInput(attrs= {'multiple': True, 'webkitdirectory': True, 'directory': True})) This is the raw post payload: ------WebKitFormBoundaryPbO3HkrKGbBwgD3sd1 Content-Disposition: form-data; name="csrfmiddlewaretoken" F575Bgl4U9dzgwePPeSW2ISZKk5c3CnRoqFasdasD0Hep6nD0LnAAObXbF92SUa96NbO2 ------WebKitFormBoundaryPbO3HkrKGbBwgDsd31 Content-Disposition: form-data; name="file_field";

Django directory upload get sub-directory names

ぃ、小莉子 提交于 2019-11-30 04:47:21
问题 I am writing a django app to upload a directory of files with forms. This is the form I am using which allows upload of directory: class FileFieldForm(forms.Form): file_field = forms.FileField(widget=forms.ClearableFileInput(attrs= {'multiple': True, 'webkitdirectory': True, 'directory': True})) This is the raw post payload: ------WebKitFormBoundaryPbO3HkrKGbBwgD3sd1 Content-Disposition: form-data; name="csrfmiddlewaretoken"