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

cant download files #27

Open
EnriqueGautoSand opened this issue Jan 12, 2021 · 1 comment
Open

cant download files #27

EnriqueGautoSand opened this issue Jan 12, 2021 · 1 comment

Comments

@EnriqueGautoSand
Copy link

when i use
send_from_directory
or
send_file

i have this error
[7252:8536:0112/182339.125:ERROR:extension_function_dispatcher.cc(487)] Permission denied for metricsPrivate.recordValue

the file i want download is an pdf and show it, but the download option dont appear
in static/docs/ yes the file is in the folder but when i put all in pyinstaller in onefile i wanna the user can get the download option

on Google Chrome
image

when i use flask-desktop

image

@Widdershin
Copy link
Owner

Widdershin commented Jan 13, 2021

Hmmm looks like we're missing a handler for the downloadRequest event in pyqt5.

https://stackoverflow.com/questions/56872960/pdfjs-print-button-does-not-work-with-pyqt5

    @QtCore.pyqtSlot(QtWebEngineWidgets.QWebEngineDownloadItem)
    def on_downloadRequested(self, download):
        path, _ = QtWidgets.QFileDialog.getSaveFileName(
            self, "Save File", "sample.pdf", "*.pdf"
        )
        if path:
            download.setPath(path)
            download.accept()

This example has some hardcoded stuff for downloading pdfs but wouldn't be far off what we need.

I'm not actively working on this project anymore but if someone wants to make a pull request I'll review it.

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

No branches or pull requests

2 participants