New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 290562 link

Starred by 17 users

Issue metadata

Status: Archived
Owner: ----
Closed: Nov 2015
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature

Sign in to add a comment

Feature request: chrome.downloads API should allow suggested download location

Reported by, Sep 13 2013

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.37 Safari/537.36

Steps to reproduce the problem:
None. This is a new feature request for the chrome.downloads API.

What is the expected behavior?
At the least, I would like to be able to use the onDeterminingFilename event to suggest a download location outside of the user-specified download location, prompting the user to verify.

What went wrong?
Currently, code handling the onDeterminingFilename event doesn't seem to be able to suggest a filename containing an absolute path, which means that it has limited control over the download location.

Did this work before? No 

Chrome version: 30.0.1599.37  Channel: beta
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 11.8 r800

Security concerns seem to make it a good idea to disallow saving to an arbitrary path without user interaction. Therefore, this could be restricted so that modifying the filename path will always display a "save as" dialog, requiring user confirmation of a download location.
Labels: Cr-UI-Browser-Downloads
Status: Untriaged
Confirming the issue as this is a feature request. Waiting for more inputs on this

Comment 2 by, Sep 20 2013

Labels: -Pri-2 -Type-Bug Pri-3 Type-Feature

You're right about the intent of the current design. It was due to security and portability.

Note that prompting would only work if the parent directory already exists. How would an extension discover which paths are valid outside the downloads directory?

Comment 3 by, Sep 20 2013

Labels: -OS-Windows OS-All

I don't think it's appropriate for the extension to be able to tell if a path is valid or not. I assume that the OS has standard expected behavior for opening a Save dialog with an invalid directory, but the behavior I'd expect as a user would be one of the following, in order of preference:

1. The dialog opens to the closest existing parent of the suggested path. E.g: a suggested path of C:\foo\bar\baz\ would open to C:\foo\bar\ if \baz\ does not exist, and to C:\foo\ if \bar\ does not exist.

2. The dialog ignores the suggestion and opens to the originally determined path.

In either case, it's probably better if the extension does NOT get feedback regarding the existence of the directory. By tracking the download's progress it can determine where the file ended up, but not why it was put in a different location than the extension suggested.
I would not expect a user to look very closely at the Save dialog, which they would have to do in order to see that they are about to receive a file to a non-standard directory.

We considered this use case when designing onDeterminingFilename, and we thought that it would be acceptable to ask the user to create a symlink from ~/Downloads/usb to /media/usb. Yes, that's a very unusual thing for a chrome user to have to do, but this feature is also very unusual.

gregory: Can you ask the user to create a symlink?
@benjhayden: The extension I'd like to build would remember download destinations based on download URI, and provide suggested download locations by matching the new download URI to previous download URIs.

In other words: the extension would make chrome remember that downloads from get put in ~/media/music, and downloads from get put in ~/projects/common/textures. The extension would update this list based on user choices without the user having to edit the list in settings.

This is based on the default behavior in Firefox, which I miss as I'm moving to Chrome. I don't think it's unusual behavior. A few other example extensions: always save .JPGs to a photo directory; alphabetize all PDFs in folders according to their first letter; automatically create a folder for the artist of an MP3 if it's listed in the filename according to an established convention. (In fact, considering these use cases, I might prefer that the system prompt a user for permission to create a non-existent directory instead of defaulting to a parent.)

My use case would require a symlink from ~/Downloads to C:\ (etc.), which seems like a bad approach.

Default extensionless Chrome behavior is to not display a save dialog at all when downloading. The fact that a Save dialog is showing is a sign that something has been customized, either via extension or by setting Chrome to always prompt for download location.
Status: Available
Sounds cool!

So it sounds like what you really want is to suggest that onDeterminingFilename put the file in the same directory as another download. We'd still need to talk to security team about it, but I think they'd be more likely to go for that than letting the extension handle the path itself, even if it did force prompting.

Would that be an acceptable compromise?
Is there another compelling use case that would actually require letting the extension handle the path?

I think that compromise would work: when a download gets saved to a directory, the directory gets added to a Chrome-internal whitelist. Chrome will accept a destination suggestion from an extension as long as it's on that whitelist.

Items on this whitelist should survive even if the Downloads list is cleared and the extension shouldn't have to search through the Downloads list itself for a download with a matching destination. Ideally an extension would just suggest a path as a string and Chrome would determine whether or not to accept that suggestion.

I can think of a few use cases where it would be useful to a user for an extension to be able to suggest directories that don't exist: an extension that provides an alternative to the "save as -> webpage, complete" functionality; an extension that saved images into directories according to their dimensions, for desktop background collectors; an extension that helps users of save every piece of interactive fiction in an arbitrary tag/list/genre to an appropriately named directory.

I don't know if these use cases are compelling enough to justify adding the functionality.

Comment 9 by, Nov 19 2013

I second this request!
I don't get the issue with non-existent folders, though. What's wrong with adding them? If I start a download with location "x/y/z/test.file" in the default download folder, the whole hierarchy of folders will be created. What's the difference to outside of it?
And trying to create a similar extension as the one benjhayden mentioned, I also realized, that it makes a difference if the user changed the download location manually or not.

So would you mind adding either a "defaultFolder"-attribute to chrome.downloads for comparisons or an additional boolean value "inDefaultFolder" or "FolderChangedByUser" to DownloadItem?
I also think this feature is important for chrome.downloads API. My use case is that I want to be able to set download location based on some rules, e.g. by the file type, the host name.

I think user can explicitly set a whitelist for each extension. The extension can only suggest locations inside the whitelist, otherwise the default location is used. Since extension actually has no access to the file system, this whitelist is only use to suggest location for chrome.downloads API. I think this is quite secure for users.
So you're basically duplicating this: ?
Wanna pair up instead?

Comment 13 by, Nov 16 2015

Status: Archived
There was no activity on this issue for over a year, and benjhayden is now working on a different project, so I would like to Archive this.
I use the Chrono download manager extention. Is it currently possible for Chrono to remember the last download location? Whenever I have to download a lot of files from one website into the same folder, I basically have to click my way through the destination folder every single time, which is incredibly tedious.

Comment 15 Deleted

Comment 16 by, Oct 27 2016


or this extension might simply go away and get bad rep.
Can we UNarchive this?  This feature is badly needed.
The last download location is a MUST, no way out!

Comment 19 by, Apr 2 2017

I start wondering whether it is really a "secure" solution to always download into the same folder. 

Remembering the download directory on hostname and/or file extensions should not even require an extension, it should be built in, similar to FireFox. It is defeating being an organized person when you always have to manually chose the download location when for example getting your statements of account from your online banking website - I want to keep them in a folder per bank. Not all mixed up with myriads of completely different downloads in my general "Downloads" directory.

Comment 20 by, Jun 4 2017

This is really stupid if such a basic feature is not there. But hey, the conceited Google have done a lot of things like that, coining them "beating the norm".
Please add this remember last download location or at least add functionality to API so that extensions can use it. this is very very essential feature . 
Please unarchive this and add an option to specify the default downloads directory in Chrome. Sheesh guys. 

Can only support those who say this is an essential feature, it does not have to be able as default, but as an option, so I and not a browser deside how to organise my files/downloads 

This is an essential basic feature.  Why isn't it not there in the first place and why in all these years Google isn't capable of adding it????
Going nuts having to re-navigate all my banking downloads.  About it being an arbitrary path - it's not, its a path I'd have already chosen manually the previous time, and I'd still be using the same path.  At least remember the path if downloading from the same website.  If you don't want to create a full-featured download in Chrome, at least allow enough APIs so extensions can be built that do more.
goog is short of resources i think...:-D

Sign in to add a comment