admbrowser icon indicating copy to clipboard operation
admbrowser copied to clipboard

Download file

Open gragia79 opened this issue 5 years ago • 4 comments

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.

gragia79 avatar Oct 05 '20 02:10 gragia79

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: ???

stroobandt avatar Dec 12 '22 10:12 stroobandt

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.

alandmoore avatar Dec 12 '22 19:12 alandmoore

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.

stroobandt avatar Dec 30 '22 14:12 stroobandt

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.

alandmoore avatar Jan 04 '23 16:01 alandmoore