-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add support for exporting .torrent from WebUI #16968
Add support for exporting .torrent from WebUI #16968
Conversation
qBittorrent/src/webui/webapplication.h Line 51 in 56667e7
Almost forgot, this should be bumped to |
element.setAttribute("href", url); | ||
element.setAttribute("download", name + ".torrent"); | ||
document.body.appendChild(element); | ||
element.click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there really no direct way to do this without creating some element behind the scenes and emulating the impact on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially looked into sending the Content-Disposition
header, which indicates to the browser that the response should be downloaded, but it doesn't appear that there's plumbing yet to allow setting arbitrary headers from API routes.
ed6c958
to
0c65f6f
Compare
@Piccirello |
This PR adds the new "Export .torrent" (#16886) functionality to the WebAPI/WebUI. Props to @Chocobo1 for making this as easy as possible. This has been tested in Firefox, Safari, and Chrome.