Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download file only after user confirm it #938

Open
XakerTwo opened this issue Oct 5, 2024 · 3 comments
Open

Download file only after user confirm it #938

XakerTwo opened this issue Oct 5, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@XakerTwo
Copy link

XakerTwo commented Oct 5, 2024

The issue
Chromium starts downloading file automatically even you have set Ask where to save each file before downloading. Downloading starts in the same moment as Save as dialog appear. While generally it's optimization of the time wasting, there can be certain cases when it's unwanted

  1. Just user want
  2. Connection fee, etc. so you just prepare and wait for certain moment to hit Enter
  3. Slow target storage, pretty unusual and my case, so i will describe it in additinal context part

Solution
Not think this will often changes so flag should be enough, but if on-the-fly solution/setting possible will prefer it. Anyway it should prevents downloading until user specify location and press the Save button in the Save as dialog

Alternative solution
only for 3rd case - move the file after download finished. yes, it can be done manually, but then you need to track file downloads

Additional context

User-case time 😄
From time to time i visit no-internet-area for a long time, so i load some media to pretty cheap and slow flash drive (it's intended properties). Problem with auto-downloading is that, when the Save button pressed, browser start moving downloaded part of the media to specified location, and, while do so, it pause(or rather hang) all downloads until moving finished. Now time optimization become a time wasting x drive' snail-rating x downloads count, especially when loading more than one file to the snail-drive.

@XakerTwo XakerTwo added the enhancement New feature or request label Oct 5, 2024
@Half-Modern
Copy link

Even in Firefox, file starts downloading as soon as the dialog appears. If you know one program that doesn't do that, you can tell us. But it always has been the same for any program that downloads files.
It could work one way: If the program manages to "pause" the download, but then it wouldn't be good for sites where they don't allow pausing downloads (and making you have to get through a painful process in order to download it again).
So they also had to consider that and let it go instead.

@oleedd
Copy link

oleedd commented Oct 5, 2024

When you initiate a file download through the browser, the server sends the file in the body of the HTTP response. The server may include headers that provide additional information about how the browser should handle the file, such as whether to prompt the user to save it or open it directly.
Regardless of the specific headers included, the file itself is always transmitted in the body of the response. The browser receives this response and decides how to handle the file based on its contents and headers.

So there is no additional request which could be used after confirming.

Chromium doesn't know if pausing is supported since it doesn't support multipart downloading.

@XakerTwo
Copy link
Author

XakerTwo commented Oct 5, 2024

have not thought about this side of issue...
thinking about it now, i can only suggest getting only the response headers and cancel downloading until user hit the Save button, then use the same URL. Re-downloading of few Bytes(KBytes) more relevant than waiting several minutes. But some services provide not just tokenized link, but single-use link and this case will be an issue as well...

💥

... wait, what if the downloading will be "hanged", like it happens on moving, but only the current downloading with unconfirmed location? Abusing some part of issue may solve the whole issue, sure if it possible. Most of the downloads(browser downloads) done over TCP where the receiving confirm is mandatory. Long delay probably will cause rejecting, but few secs to specify location should be ok (up to 20 by default, if i'm correct)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants