Waboodoo / HTTP-Shortcuts

Android app to create home screen shortcuts that trigger arbitrary HTTP requests
https://http-shortcuts.rmy.ch
MIT License
1.17k stars 113 forks source link

Large file download #323

Closed opk12 closed 1 year ago

opk12 commented 1 year ago

Is your feature request related to a problem? Please describe. I discovered this app recently and I'm not sure if this is a supported use case, but I want to download a GB-sized file on the SD card. From a quick test, the app seems to download the response and then show the Save button. Instead, this feature requires to first select the destination, then download.

Additional context My broader use case is that my home server generates OsmAnd and Organic Maps maps files (300-400 MB each) and downloads the Kiwix dictionary from the Internet (> 1 GB). Ideally, the phone would auto-update based on a periodic trigger (in-app or via intent) but, for the moment, I hope to use the app's multi-shortcut launch feature to reduce my interaction to one or few taps.

Waboodoo commented 1 year ago

This is currently not possible. As you correctly observed, the app will always download the HTTP response to the internal storage and then show the option to copy it to a file.

Here's how I imagine this feature could work: In the "Response Handling" screen, a "Store response in file" option is added, which allows to choose a destination directory in the file system. Additionally, it might be useful to have an option there to choose a naming scheme for the files that will be placed in that directory.

Would that solve your use case?

opk12 commented 1 year ago

Yes, I think so. In my case, I do not need a custom naming scheme, but I agree that it would be useful in general.

Waboodoo commented 1 year ago

In the next version (2.31.0), there will be a feature to store the response body into a file. It can be accessed via a checkbox found in the Response Handling section in the shortcut editor. @opk12 If you want to already test it, you can join the beta program. Otherwise, I'm hoping to release the new version within this week.

Waboodoo commented 1 year ago

Version 2.31.0 is now released, which includes a feature to store the HTTP response into a file

opk12 commented 1 year ago

Sorry for the late reply. This is what I needed, thank you!

The file is first downloaded to the internal memory, then moved to the SD card, is that right? Is it possible to download directly to the SD card (for robustness in case of low internal memory, and should be a bit faster) do I open a separate ticket for that?

Waboodoo commented 1 year ago

Currently, the file is always downloaded to internal storage, then copied over to the designated directory. The file in the internal storage is then deleted shortly after. I agree with you that it would make more sense to avoid this internal copy of the file. Currently this is a bit of a technical limitation that I need to make some changes for first. Since this issue here is already closed, I suggest you create a new issue.