Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

browser.download.lastDir.savePerSite does not work

more options

When downloading files, Firefox no longer remembers the directory path the file was previously saved to on a per-URL basis.

Previous Firefox behavior: #1. download file from website "aaaa.com" to a folder on your computer, "user/frank/companies/aaaa/". #2. download file from website "bbbb.com" to a folder on your computer, "user/frank/companies/bbbb/". #3. Now, go back to the website "aaaa.com" and attempt to download another file. Firefox used to present the previously used directory for this particular URL, in this case, "user/frank/companies/aaaa/" - but instead, now it presents the most recently used directory path, which was "user/frank/companies/bbbb/".

This issue has appeared before and the advice to fix it was to go about:config, search for browser.download.lastDir.savePerSite and make sure it is set at TRUE. I have done this, but the issue remains: Firefox no longer remembers saved file directory paths on a per-URL basis.

MacOS 11.6.6 (Big Sur); Latest Firefox (103.0.2) Attempts to fix: Safe Mode - issue still present; Refresh Firefox - issue still present

Is there any advice on how to fix this problem? - Thxs.

When downloading files, Firefox no longer remembers the directory path the file was previously saved to on a per-URL basis. Previous Firefox behavior: #1. download file from website "aaaa.com" to a folder on your computer, "user/frank/companies/aaaa/". #2. download file from website "bbbb.com" to a folder on your computer, "user/frank/companies/bbbb/". #3. Now, go back to the website "aaaa.com" and attempt to download another file. Firefox used to present the previously used directory for this particular URL, in this case, "user/frank/companies/aaaa/" - but instead, now it presents the most recently used directory path, which was "user/frank/companies/bbbb/". This issue has appeared before and the advice to fix it was to go about:config, search for browser.download.lastDir.savePerSite and make sure it is set at TRUE. I have done this, but the issue remains: Firefox no longer remembers saved file directory paths on a per-URL basis. MacOS 11.6.6 (Big Sur); Latest Firefox (103.0.2) Attempts to fix: Safe Mode - issue still present; Refresh Firefox - issue still present Is there any advice on how to fix this problem? - Thxs.

Chosen solution

Ok, after hunting around a lot, I finally found a post that pointed to why this is happening.

[Firefox 104.0; MacOS].. Preferences (Settings) -> General -> Applications -> Portable Document Format (PDF). .. I have this set to "Open in Firefox". I always like to look at the PDF first and then decide if I want to download it or not. .. Apparently, if you display the PDF first and then download it, the URL location is not saved and therefore can't be used to associate it to a remembered download path.

I changed this setting to "Always Ask," which immediately presents the "Save As..." dialog box without previewing the PDF first, and yes, finally, the download path is remembered on a per-site basis.

I'm guessing.. @pg_78 you must have yours set to "Always Ask" and @greyguy and I have ours set to preview?

Any way, I guess I need to make another post with a feature request for "Open in Firefox" files to retain their URL info for use with the remembered download path feature - but I'm guessing this may not be possible.

FYI: This is the forum post that I found: Assigning download directory by website

Read this answer in context 👍 2

All Replies (17)

more options

I also have this problem, it is very annoying. I have absolutely loved that Firefox remembers download locations on a domain basis! ❤

Two thoughts:

  1. Can anyone else please confirm that Firefox no longer remembers download locations on a domain basis?
  2. For Firefox developers: has browser.download.lastDir.savePerSite stopped working?

I am on Firefox 103.0.2 on Windows 10.

EDIT: This hasn't worked for me for maybe a year or so.

Modified by greyguy

more options

Interesting to see this issue is also present for Windows users.

Since I posted this issue, I wiped my hard drive and did a clean install to the latest MacOS operating system, 12.5.1 (Monterey) (as a pre-planned upgrade, not just to test this issue). This of course included a fresh install of Firefox (103.0.2). I retested: Firefox still does not remember the download path on a per-URL basis for previous downloads. .. Same as @greyguy, I'd say it's also been about a year since I noticed this started to happen.

I'll tweak @greyguy's question: -For Firefox developers: is this a bug -or- has browser.download.lastDir.savePerSite functionality been purposely removed? (If so, please bring it back!!)

Modified by gvmelbrty

more options

greyguy said

  1. Can anyone else please confirm that Firefox no longer remembers download locations on a domain basis?

It's working correctly for me (FF 103.0.2 on Windows 10). I agree this is an extremely useful feature of FF so I hope you can get it fixed!

more options

One thought (I'm not a Firefox dev, so I'm guessing really). This data is stored in the profile (edit - as jscher2000 says downthread, specifically in "content-prefs.sqlite"). So it's possible that if a site gets cleared out of your history, that could remove the remembered download locations?

Modified by pg_78

more options

Things like that are stored as part of the "Site settings", so make you keep those. Also "Resist Fingerprinting" could be disable this feature.

more options

Thanks @pg_78 for confirming this feature DOES work for some people. Do you remember if you changed any of the default prefs in Firefox?

Thanks @cor-el for the "resist fingerprinting" idea..

I found "fingerprinting" mentioned in Preferences -> Privacy & Security -> Enhanced Tracking Protection. I changed this setting from the default "Strict" to "Standard" (which says it still blocks fingerprinting). Just tested.. unfortunately no, this did not fix it for me.

Next, I changed Enhanced Tracking Protection to "Custom" and turned off "fingerprinters" blocking. No luck - Firefox still displays only the most recent download location, not the remembered download path for the individual domain.

Modified by gvmelbrty

more options

FYI: This same issue was discussed at mozillaZine on July, 2020: mozillaZine.org - browser.upload.lastDir.savePerSite

Modified by gvmelbrty

more options

FYI: This same issue was discussed at mozillaZine on July, 2020: browser.upload.lastDir.savePerSite

more options

gvmelbrty said

Thanks @pg_78 for confirming this feature DOES work for some people. Do you remember if you changed any of the default prefs in Firefox?

I have changed various preferences... but I don't think that any of them relate to this feature (and I do try to keep a note of what I change).

I do run with Strict settings for tracking protection, so it seems like that in itself wouldn't be the cause of your issue.

more options

You should not need to manually set savePerSite to true, that is the default behavior.

greyguy said

EDIT: This hasn't worked for me for maybe a year or so.

gvmelbrty said

Same as @greyguy, I'd say it's also been about a year since I noticed this started to happen.

Last-used upload and download paths are stored in the content-prefs.sqlite database file as you browse, as long as you are not using a private window (Firefox treats the file as read-only for private windows).

To expand on cor-el's first point:

These paths should persist from one session to the next as long as you do not clear "Site settings" (previously labeled "Site preferences"). It's possible to accidentally flush that data through the "Clear history when Firefox closes" feature. If you have that enabled, click its Settings button to make sure you are not clearing Site settings:

more options

jscher2000 - Support Volunteer said

Last-used upload and download paths are stored in the content-prefs.sqlite database file as you browse, as long as you are not using a private window (Firefox treats the file as read-only for private windows).

You're right on this - I will edit my earlier post (the "moz-annos" table in places.sqlite looks like it tracks where specific files were downloaded to, rather than a preference per site).

more options

Chosen Solution

Ok, after hunting around a lot, I finally found a post that pointed to why this is happening.

[Firefox 104.0; MacOS].. Preferences (Settings) -> General -> Applications -> Portable Document Format (PDF). .. I have this set to "Open in Firefox". I always like to look at the PDF first and then decide if I want to download it or not. .. Apparently, if you display the PDF first and then download it, the URL location is not saved and therefore can't be used to associate it to a remembered download path.

I changed this setting to "Always Ask," which immediately presents the "Save As..." dialog box without previewing the PDF first, and yes, finally, the download path is remembered on a per-site basis.

I'm guessing.. @pg_78 you must have yours set to "Always Ask" and @greyguy and I have ours set to preview?

Any way, I guess I need to make another post with a feature request for "Open in Firefox" files to retain their URL info for use with the remembered download path feature - but I'm guessing this may not be possible.

FYI: This is the forum post that I found: Assigning download directory by website

more options

gvmelbrty said

I'm guessing.. @pg_78 you must have yours set to "Always Ask" and @greyguy and I have ours set to preview?

I think you've put your finger on it. Actually, for PDFs I have "Open In Firefox", and the occasional times that I want to download them, then I right-click (instead of opening) and "Save Page As...". That works fine and remembers the preference.

But I just tried opening a PDF and trying to save it from within the viewer (which isn't my normal workflow) - and you're absolutely right, the per-site preference is not used in that case.

Modified by pg_78

more options

pg_78 said

gvmelbrty said

I'm guessing.. @pg_78 you must have yours set to "Always Ask" and @greyguy and I have ours set to preview?

I think you've put your finger on it. Actually, for PDFs I have "Open In Firefox", and the occasional times that I want to download them, then I right-click (instead of opening) and "Save Page As...". That works fine and remembers the preference.

Ok, so you're saying if you right click on a PDF link and select "Save link as.." that Firefox will remember the download path on a per-site basis? .. I think I'll try that for the occasional PDF downloads and leave "Open in Firefox" for use with all other PDFs. Thanks.

Modified by gvmelbrty

more options

For users that like to view PDFs in a Firefox tab, Firefox 103 added a handy new (hidden) feature that allows more of them to open on their original URLs rather than from disk. Here's how you switch it:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

More info on about:config: Configuration Editor for Firefox. The moderators would like us to remind you that changes made through this back door aren't fully supported and aren't guaranteed to continue working in the future. Since I use it myself, I feel comfortable mentioning it.

(2) In the search box in the page, type or paste browser.download.open_pdf_attachments_inline and pause while the list is filtered

(3) Double-click the preference to switch the value from false to true

Firefox will store the PDF in the web content cache like a web page. To save it to disk, you can use the method mentioned earlier (Save Page As...) or the Download button on the PDF viewer's toolbar.

more options

Thanks for your input about "browser.download.open_pdf_attachments_inline". I just tested this, changing this parameter to true.

With PDF settings in Firefox set to "Open in Firefox," while viewing the PDF, either clicking the download button or right clicking on the PDF and selecting "Save Page As..", Firefox will not honor the prior download path on a per-URL basis. ... I'm sure this new setting does something handy, but it doesn't seem to solve the issue at hand... unless I misunderstood your solution?

I think the original issue I posted has been solved. But, it requires that the PDF be downloaded directly without first previewing it: Firefox PDF setting "Always ask." Or, keep the PDF setting "Open in Firefox" to just view PDFs - and then right click, "Save link as..", on PDF links you wish to download.

more options

Okay, I see, using the Download button in the PDF viewer, or using Save Page As... in the PDF viewer uses the latest value of "browser.download.lastDir" in about:config (prefs.js) instead of the site-specific "browser.download.lastDir" in the content-prefs.sqlite database.

I found a related bug on file that had been closed because it wasn't fully understood that it was a PDF viewer issue. I added information a link to this thread along with steps to reproduce and something strange I noticed in the content-prefs.sqlite database.

https://bugzilla.mozilla.org/show_bug.cgi?id=1592160


Possible Workarounds

Not sure how easy that will be to fix. Until then, I can think of two options:

(1) Downloader add-on that can trigger a download using the address in the address bar. Not sure whether this exists.

(2) Using right-click > Save Link As... on a link to the PDF.

Such a link may not be handy if you didn't open the PDF that way. A brute force approach would be to run a script that injects the link into the viewer. Add-ons aren't allowed to do that, but a bookmarklet -- a script you run against the current "page" as a bookmark -- can. As an example of such a script:

document.getElementById('toolbarViewerLeft').insertAdjacentHTML('beforeend', 
'<a href="' + location.href + '">Self Link: right-click > Save Link As...</a>');


I posted it here for easier installation: https://www.jeffersonscher.com/res/sumomarklets.html#PDFLink

To install, you drag the blue button to your bookmarks toolbar and drop it somewhere convenient, then confirm the details when Firefox displays the Add Bookmark dialog.

To use, with the PDF viewer displayed, click the button to inject the link:

Not sure it's more convenient than navigating to the desired folder, but maybe.