Closed Bug 1762510 Opened 4 years ago Closed 4 years ago

firefox uses home dir for downloads instead of downloads directory

Categories

(Firefox :: File Handling, defect)

Firefox 98
defect

Tracking

()

RESOLVED DUPLICATE of bug 1707462

People

(Reporter: bugs, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0

Steps to reproduce:

In firefox 98 the change to downloads results in temporary downloads being saved in home directory (on linux), with always ask.

  1. Download a file
  2. Prompt displayed choose "open with" application
  3. File is opened in application, but file is also downloaded to home directory.

Actual results:

(as above)
Note that Download is set to "Always ask where to download files"

Expected results:

temporary(*) file should be downloaded to temp directory.

(*) Hence why using "Open With"

The Bugbug bot thinks this bug should belong to the 'Firefox::File Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → File Handling
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE

This isn't a duplicate. As much as I prefer the old behaviour, the download dir was set to ~/Downloads but files were saved to ~ .

(After an upgrade from previous firefox on debian).

Why isn't it a duplicate? It's making exactly the same points that you are in this bug.

Because the save directory was set to /home/user/Downloads but files saved with "Open with" were saved into /home/user (which is not set as a directory anywhere in preferences, either in the dialog or about:config).

(Cluttering up downloads is one thing, but filling $HOME is difficult as its not easily possible to disinguish downloaded files from others)

Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---

(In reply to Andrew King from comment #3)

This isn't a duplicate. As much as I prefer the old behaviour, the download dir was set to ~/Downloads but files were saved to ~ .

Can you confirm the values of browser.download.dir, browser.download.lastDir and browser.download.folderList in about:config ? The settings page will show your OS's concept of the "default downloads dir" as "Downloads", irrespective of the folder it is, and so it may be misleading you (that's bug 1707462). If we can't detect a default downloads folder (quite possible depending on the linux distro/setup), desktop and then the home directory are used as fallbacks for the downloads directory (I mean, we've gotta assume you want the files somewhere!).

Another check just to be on the safe side: does ~/Downloads exist and is it writable?

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(bugs)
Summary: firefox uses home dir as temp directory → firefox uses home dir for downloads instead of downloads directory

They are currently
browser.download.dir = /tmp (I manually changed this, trying to get previous behaviour back) **
browser.download.lastDir = (a directory I have used to save previously)
browser.download.folderList = 2

** I upgraded on a different machine, and
browser.download.dir = (doesn't exist)
browser.download.folderList = 1

~/Downloads exists, and is shown in the interface as the location for "Save files to" - obviously this is different to the result (which is home), probably as browser.download.dir is unset.

Flags: needinfo?(bugs)

(In reply to Andrew K from comment #7)

They are currently
browser.download.dir = /tmp (I manually changed this, trying to get previous behaviour back) **
browser.download.lastDir = (a directory I have used to save previously)
browser.download.folderList = 2

So I'm a bit confused (sorry!) because of the 2 sets of answers - is the setup with these 3 prefs above (now) working, or still saving files into $HOME despite browser.download.dir indicating you want them in /tmp?

** I upgraded on a different machine, and
browser.download.dir = (doesn't exist)
browser.download.folderList = 1

~/Downloads exists, and is shown in the interface as the location for "Save files to" - obviously this is different to the result (which is home), probably as browser.download.dir is unset.

OK, so in the second set of prefs, folderList being 1 indicates it's supposed to use the system default downloads directory, and Firefox will try to follow your XDG user preferences to find out what that is. I have a few different sets of questions about this different machine:

  1. do you have any XDG environment variables set, e.g. does XDG_CONFIG_HOME exist, and does a file called user-dirs.dirs exist anywhere in $HOME or $HOME/.config or similar? Does that define a system downloads directory?
  2. does setting browser.download.dir to /home/<username>/Downloads and browser.download.folderList to 2 in about:config, fix the issue?
  3. are you by any chance using a snap or flatpak build of Firefox? (If you're not sure about this, you can check in about:support, under "Application Binary", if the path starts with /snap/ or contains it, it's probably a snap build)
  4. what window manager / desktop environment / distro is this happening under?
Flags: needinfo?(bugs)

The first case is working (after manually setting).

.config/user-dirs.dirs

  1. has a XDG_DOWNLOAD_DIR="$HOME/", no env variables set though
  2. it seems to (w.r.t this bug).
  3. no, native install
  4. xfce on debian 11.

It's quite possible that ff appears to be doing the right thing. But, on an update "Always ask you where to save files" was already set, and "Save files to" was set to "Downloads" (but greyed out). It's wasn't obvious why my home dir was being filled with temporary downloads.

Probably at least on update, the following should be set if "Always ask you where to save files" is set.
browser.download.dir = /tmp
browser.download.folderList = 2

Flags: needinfo?(bugs)

(In reply to Andrew K from comment #9)

Probably at least on update, the following should be set if "Always ask you where to save files" is set.
browser.download.dir = /tmp
browser.download.folderList = 2

This would probably confuse people who are fine with the current setup, and would break for snap users (where Firefox can't write to /tmp). A lot of the complaints around the change are about "Firefox changed my settings without asking"; I am skeptical that changing some more settings without asking will make anything better. :-(

It seems like the real problem here is that the UI does not reasonably reflect what is happening, which we will fix in bug 1707462 and bug 1762775. I'll dupe this over to bug 1707462 as even just changing that would probably have helped you here (ie if the folder selector said "/home/username" instead of "Downloads"

Status: NEW → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → DUPLICATE

(We're still evaluating what to do about the tmp dir; updates will appear in bug 1738574)

You need to log in before you can comment on or make changes to this bug.