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 #17

Open
gragia79 opened this issue Oct 5, 2020 · 4 comments
Open

Download file #17

gragia79 opened this issue Oct 5, 2020 · 4 comments

Comments

@gragia79
Copy link

gragia79 commented Oct 5, 2020

Hello, congratulations for the well structured and ordered code.
I ask, how can I download a file?
my call is:
<a href='Controller/name_file/date' targhet='_blank' /a>
the called controller processes the data and responds with a octed-stram header.
in my case I use codeigniter 4

return $ this-> response-> download ($ file, null) -> setFileName ($ fileName);

the browser sees the request twice.

header octed-stream
i set admbrowser.yaml

content_handlers:
  'application / octed-stram': 'file'

and the file is downloaded.
But the window new tab stays open in 'abaut: blank'.
How should I set the download header?
Or
How can I close the window new tab when the download is finished?
Thank you

just for information python-yaml is no longer maintained you have to use pyYAML.
To change in requirements.

@stroobandt
Copy link
Contributor

I am experiencing a similar problem. I would like to download an octet-stream and simply save it. I am wondering what handler would correspond to a Qt file save dialog.

allow_external_content: True
content_handlers:
  application/octet-stream: ???

@alandmoore
Copy link
Owner

I haven't had my head in Qt for a while, but I'm assuming one would need to implement a save dialog and file saving of some sort. I took a quick look over the docs and didn't see anything obvious built in to QtWebEngine.

Given that ADMBrowser is aimed at kiosk / locked down usage, I'd be interested in hearing a use case for downloading and saving files. That's one of the many things I created this browser to not have, though if there is an arguable use case I would accept a PR as long as it was disabled by default.

@stroobandt
Copy link
Contributor

Here is a use case:
A library thin client with only USB ports provides default access to https://pubmed.ncbi.nlm.nih.gov
The accessible USB port allows to download medical scientific papers in PDF on a USB memory stick.

Here is another one:
ADMbrowser manages the web interface of a router or headless system.
Using ADMbrowser as a dedicated browser in this case provides additional security by preventing keystroke recording attacks. The web interface allows for downloading a backup of the router settings in a proprietary file format.

@alandmoore
Copy link
Owner

That makes sense. This is a feature that would definitely be disabled by default, and one would want to be able to secure it to make sure the download dialog doesn't become a back door to browsing the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants