How to use Google Chrome 11 download feature in my own code?

Google Chrome 11 now supports downloading folders. Currently, this feature is only implemented in Google Docs, and I could not find any API documentation on how to use it in my code.

From what I see, you click the "Download Folder" link in Google Docs, which displays the "Browse for Folder" dialog box (calling SHBrowseForFolder in appearance), you select a folder, and then the contents of this folder are uploaded to Google Docs.

Since this function requires updating Google Chrome to the latest version or for other browsers that run the Java applet, I assume that I can use this function on my own websites?

I would really like to have this feature in the content management system that I support!

+54
html5 google-chrome multifile-uploader
Apr 28 2018-11-11T00:
source share
1 answer

Here you can see the demo: http://html5-demos.appspot.com/static/html5storage/demos/upload_directory/index.html

This basically works by setting the "webkitdirectory" attribute to the file input element.

<input type="file" id="file_input" webkitdirectory="" directory=""> 

Then, when the user selects the folder, he iterates over the "e.target.files" object to get a list of the files included in the selection (this allows you to access these files from clients).

Drag and drop is similar when you listen to the โ€œondropโ€ event on the โ€œdraggedโ€ element, if the aa directory or file selection is deleted on the element, the โ€œfilesโ€ property in the event will be a list of files contained in the operation.

+73
May 01 '11 at 15:29
source share
โ€” -



All Articles