Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Extension- Change download folder for specific download

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?

like image 314
user2933258 Avatar asked Oct 05 '17 10:10

user2933258


People also ask

Can I change Downloads folder location?

From File Explorer, right-click the Downloads folder and select Properties > Location, then type the desired location into the text field and select OK. Be aware that when you set the new location, you'll still need to designate the Downloads folder.


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.

like image 193
Xan Avatar answered Oct 22 '22 20:10

Xan


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

RegExp

like image 1
benjamintemitope Avatar answered Oct 22 '22 18:10

benjamintemitope