Trouble to download via "download as" from File menu

The change has been operated

docker exec -it onlyoffice-onlyoffice-documentserver-1 /bin/bash
root@222b14f30c95:/# cat ./etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.75.22.129 nam-gedt.ansm-intra.fr
192.168.64.4 222b14f30c95
10.75.22.130 nam-onlyofficet.ansm-intra.fr

After that, the tset example works fine !
BUT, in our application the initial behaviour remains the same. Please have a look on logs below when use “dowload as”

[2024-06-05T13:45:41.339] [DEBUG] [localhost] [c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277] [userId] nodeJS - Start downloadAs: {"c":"save","id":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277","userid":"ahassain","tokenSession":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb2N1bWVudCI6eyJrZXkiOiJjMDhmMWE1NS0zNTYyLTRlM2YtYTg5Ny01NWRhNjEwNmIzZTVfMTcxNzU5NDYzNjI3NyIsInBlcm1pc3Npb25zIjp7ImVkaXQiOnRydWUsImNvcHkiOnRydWUsInByaW50IjpmYWxzZX19LCJlZGl0b3JDb25maWciOnsidXNlciI6eyJpZCI6ImFoYXNzYWluIiwibmFtZSI6IkFoYXNzYWluIiwiaW5kZXgiOjJ9LCJkc192aWV3IjpmYWxzZSwiZHNfaXNDbG9zZUNvQXV0aG9yaW5nIjpmYWxzZSwiZHNfc2Vzc2lvblRpbWVDb25uZWN0IjoxNzE3NTk0NjM5MDAxfSwiaWF0IjoxNzE3NTk0NjM5LCJleHAiOjE3MjAxODY2Mzl9.r2ku8w8jCsuqdkM0OsXCm7lN1Uhu5Fio-vqDiUBNcRI","outputformat":65,"title":"Nouvelle fiche.docx","nobase64":true,"lcid":12,"savetype":3,"saveindex":1,"userconnectionid":"ahassain2"}
[2024-06-05T13:45:41.340] [DEBUG] [localhost] [c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277] [userId] nodeJS - checkJwt success: decoded = {"document":{"key":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277","permissions":{"edit":true,"copy":true,"print":false}},"editorConfig":{"user":{"id":"ahassain","name":"Ahassain","index":2},"ds_view":false,"ds_isCloseCoAuthoring":false,"ds_sessionTimeConnect":1717594639001},"iat":1717594639,"exp":1720186639}
[2024-06-05T13:45:41.365] [DEBUG] [localhost] [c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277] [userId] nodeJS - End downloadAs: {"type":"save","status":"ok","data":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277_8417"}
[2024-06-05T13:45:41.559] [INFO] [localhost] [c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277] [userId] nodeJS - receiveTask start: {"ctx":{"tenant":"localhost","docId":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277","userId":"userId","shardKey":"https://nam-gedt.ansm-intra.fr/any/rest/wopihost/files/c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277"},"cmd":{"c":"save","id":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277","userid":"ahassain","userindex":2,"tokenSession":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb2N1bWVudCI6eyJrZXkiOiJjMDhmMWE1NS0zNTYyLTRlM2YtYTg5Ny01NWRhNjEwNmIzZTVfMTcxNzU5NDYzNjI3NyIsInBlcm1pc3Npb25zIjp7ImVkaXQiOnRydWUsImNvcHkiOnRydWUsInByaW50IjpmYWxzZX19LCJlZGl0b3JDb25maWciOnsidXNlciI6eyJpZCI6ImFoYXNzYWluIiwibmFtZSI6IkFoYXNzYWluIiwiaW5kZXgiOjJ9LCJkc192aWV3IjpmYWxzZSwiZHNfaXNDbG9zZUNvQXV0aG9yaW5nIjpmYWxzZSwiZHNfc2Vzc2lvblRpbWVDb25uZWN0IjoxNzE3NTk0NjM5MDAxfSwiaWF0IjoxNzE3NTk0NjM5LCJleHAiOjE3MjAxODY2Mzl9.r2ku8w8jCsuqdkM0OsXCm7lN1Uhu5Fio-vqDiUBNcRI","data":null,"title":"Nouvelle fiche.docx","outputformat":65,"outputpath":"output.docx","savetype":3,"saveindex":1,"status_info":0,"savekey":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277_8417","userconnectionid":"ahassain2","lcid":12,"nobase64":true,"originformat":65}}
[2024-06-05T13:45:41.564] [DEBUG] [localhost] [c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277] [userId] nodeJS - receiveTask publish: {"type":"save","status":"ok"}
[2024-06-05T13:45:41.565] [INFO] [localhost] [c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277] [userId] nodeJS - receiveTask end
[2024-06-05T13:45:41.566] [DEBUG] [localhost] [c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277] [userId] nodeJS - pubsub message start:{"type":7,"ctx":{"tenant":"localhost","docId":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277","userId":"userId","shardKey":"https://nam-gedt.ansm-intra.fr/any/rest/wopihost/files/c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277"},"cmd":{"c":"save","id":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277","userid":"ahassain","userindex":2,"tokenSession":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb2N1bWVudCI6eyJrZXkiOiJjMDhmMWE1NS0zNTYyLTRlM2YtYTg5Ny01NWRhNjEwNmIzZTVfMTcxNzU5NDYzNjI3NyIsInBlcm1pc3Npb25zIjp7ImVkaXQiOnRydWUsImNvcHkiOnRydWUsInByaW50IjpmYWxzZX19LCJlZGl0b3JDb25maWciOnsidXNlciI6eyJpZCI6ImFoYXNzYWluIiwibmFtZSI6IkFoYXNzYWluIiwiaW5kZXgiOjJ9LCJkc192aWV3IjpmYWxzZSwiZHNfaXNDbG9zZUNvQXV0aG9yaW5nIjpmYWxzZSwiZHNfc2Vzc2lvblRpbWVDb25uZWN0IjoxNzE3NTk0NjM5MDAxfSwiaWF0IjoxNzE3NTk0NjM5LCJleHAiOjE3MjAxODY2Mzl9.r2ku8w8jCsuqdkM0OsXCm7lN1Uhu5Fio-vqDiUBNcRI","data":null,"title":"Nouvelle fiche.docx","outputformat":65,"outputpath":"output.docx","savetype":3,"saveindex":1,"status_info":0,"savekey":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277_8417","userconnectionid":"ahassain2","lcid":12,"nobase64":true,"originformat":65},"output":{"type":"documentOpen","data":{"type":"save","status":"ok"}},"needUrlKey":"c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277_8417/output.docx","needUrlMethod":2,"needUrlType":1}
[2024-06-05T13:45:41.567] [DEBUG] [localhost] [c08f1a55-3562-4e3f-a897-55da6106b3e5_1717594636277] [userId] nodeJS - sendData: type = documentOpen

Why, in our context, “Save Copy As” option does not appear as option in File Menu ?

As I can see downloadAs task starts and finishes successfully still. It seems like something is blocking download window from appearing. Can you open example once again and try downloading any file from there but not from the editor interface? I mean from here via icon below Download:
image
In general, does your browser allow downloads from any other source?


By the way, I’ve asked to provide initialization config to see how editor object is defined and with which parameters, it could be possible to find something there:

Hi @Constantine

Just to confirm that is possible to download files from “download” icon (see below sceenshot)

and the browser I use allows downloads from any source.

How to find the intializing config you ask me to provide ? is it default.json or something else ?
Thanks in advance

Initialization config is a part of integration with your app that defines various parameters with which editor is displayed when opening a document for editing/viewing. As an independent integrator you should know how it is utilized in your integration.

Integration of onlyoffice with our app (ECM) is done on WOPI protocol.
please have a look on our app’s logs in debug mode to well understand

20240607_catalina.docx (55.2 KB)

Sorry, it was mentioned earlier and I forgot about it.

Considering that there are no errors in logs that may indicate to the root of issue, please try do the following to obtain more information:

  1. Open a document for editing before reproducing the issue;
  2. Open browser console (F12);
  3. Download file via Download as to reproduce the issue;
  4. Check Console and Network tabs of the browser console for any errors.

Share screenshots of any errors you find there for the reference.

Hi
In the console it seems mentionned error that tne download was blocked, because the iframe that triggered it has the sandbox option!
In attachment the har file
any error on the GUI

Is there any additionnal config to add on our Reverve Proxy ?

First of all, .har files may contain confidential information so I’d recommend avoid sharing such files publicly.

Second, it’d be much easier if you could share requested screenshots of errors directly in thread, i.e. not via an archive.

thanks for recommendations !


The download of “https://nam-onlyofficet.ansm-intra.fr/cache/files/data/967c8ce3-aa84-4d5b-a553-c9556564322e_1718024994120_7294/output.docx/CLI-UTI-REF-009.docx?md5=6YmELtyqwY38Jsrn0krEJg&expires=1718025955&WOPISrc=https%3A%2F%2Fnam-gedt.ansm-intra.fr%2Fany%2Frest%2Fwopihost%2Ffiles%2F967c8ce3-aa84-4d5b-a553-c9556564322e_1718024994120&filename=CLI-UTI-REF-009.docx” has been blocked, as the iframe that triggered it has the sandbox option.

Thanks. As I can see, frame of your application blocks downloads which explains why download window does not pop up.

Please try adding allow-downloads attribute to your frame and check if situation changes.
By the way, you can take a look at complete list of attributes that are used in our integrated test example with WOPI here for your reference:

Hello @constantine
We’ve indeed found a file in our application’s webapp called wopiframe.jsp in which we’ve added download rights. And it works fine

//office_frame.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups allow-top-navigation allow-popups-to-escape-sandbox');
office_frame.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups allow-top-navigation allow-popups-to-escape-sandbox allow-downloads');
1 Like

Hello again @ahassain

Thank you for your feedback. I’m glad that it works now. Closing topic as solved.