How to listen for the 'download' event on the menu bar in Vue framework

Hello,we are using the community version of OnlyOffice. Due to some issues in the production environment, when clicking the “Download” button in the toolbar, the download does not work properly and the browser reports an error:

Mixed Content: The page at 'https://my-domain.com/#/online-office/edit? uuid=21132feb-f19f-4889-86bd-5fa3810d5682' was loaded over HTTPS, but requested an insecure frame 'http://my-domain.com/onlyoffice-api/cache/files/data/DOC_xxxxx97_9499/output.docx/xxxxx.docx'. This request has been blocked; the content must be served over HTTPS.

At the same time, I found an “onDownloadAs” event in the API documentation (Events | ONLYOFFICE), but it did not work after being configured.
So, I want to know if there is any way for me to monitor the user’s “download” behavior in the editor and handle the download logic myself.

Thank you very much for your answer

Document Server version: v8.2

Hello @Samer

Mixed Content appears when your storage runs HTTPS and Document Server don’t. You need to disable HTTPS on your storage side (not recommended) or enable it on Document Server side. Depending on your installation type, all guides on how to enable HTTPS can be found in Help Center:


As for the downloads: are you talking about file downloads from the browser?

Thank you for your reply. We have resolved the issue with HTTPS.
As for downloading, I do refer to browser downloads, the “download as” function, and I want to monitor the user’s download behavior.

I am glad to know that the issue with HTTPS is now resolved.

Mentioned onDownloadAs is related to the editor method downloadAs:

Unfortunately, there is no direct method or event to fulfill your goal, however, I have mentioned a potential solution for this case here:

Other approach is to disable downloads from the editor completely, so that only option remains is a download button in your storage application. There you can implement any logic that will suit your case.

Thank you, I will consider your suggestion

1 Like