Use chrome.downloads.show(id) and showDefaultFolder() api is extension.

348 views
Skip to first unread message

Vikas Pushkar

unread,
Jun 9, 2016, 4:22:32 AM6/9/16
to Chromium-Extensions-Announce
using chome.downlaods.downlaod(option,callback) i have downloaded a file. i want to use the information of that file in extension. like size,type,path etc. i thought show and showDefaultFolder can help me out.
but i am not sure how to use it.

Thanks

Antony Sargent

unread,
Jun 9, 2016, 3:26:01 PM6/9/16
to Vikas Pushkar, Chromium-Extensions-Announce
The show and showDefaultFolder methods just open the OS native file manager navigated to the downloaded file file, or default downloads directory, respectively. They don't return any information about the downloaded item, they just let the user interact with the file using the OS native file manager. 

You can get the data you're interested in (mime, fileSize, filename) from the onChanged event (watch for a state of "complete" if you don't care about these until the download is finished). 

 

--
You received this message because you are subscribed to the Google Groups "Chromium-Extensions-Announce" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/b564618c-ebc7-4323-a066-5d8a4681688d%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Reply all
Reply to author
Forward
0 new messages