Chrome Extension- Change download folder for specific download

Viewed 7991

I just started to develop chrome extensions. I want to create an extension in order to change the download folder for a specific download.

Can I do such thing? if not,How can I change the default download folder before the downloads begin and then return it to the original value after the download ends?

2 Answers

You can't change the base Downloads folder - this setting is not anyhow exposed.

However, with chrome.downloads API you can put files in a subfolder of the user's Downloads folder.

You can either initiate the download yourself with chrome.downloads.download or use chrome.downloads.onDeterminingFilename request to intercept downloads from other sources.

You need to provide a relative path as a suggested name, e.g. "special/filename" to save into a subfolder special inside the Downloads folder.

Not an answer to the question but there is a Chrome Extension that can do it.

RegExp

Related