Download File While setting attachement=false not opening file in the browser

Using below Link

<a href="http://localhost:8080/app/rest/v2/files/44809679-e81c-e5ae-dd81-f56f223761d6?access_token=a2f0bb4e-773f-6b59-3450-3934cbf0a2d6&attachment=false" target="_blank" />

expected behavior that file is opened inside browser

Note:

File is PDF File not an image

Current behavior

Download file dialog is appearing as below

image

This is the link from the browser

image

Hi

Could you specify the browser you are using?

Gleb

Hi Gleb ,

FireFox over Amazon work space

Hi Gleb ,

For you information Also Chrome is not working acting the same behavior

Hi,

Unfortunately, I can’t reproduce the problem. I’ve tried Chrome, Safari and FireFox. Could you specify CUBA Platform version?

Gleb

Hi,

I’m using version 6.10.12

Still can’t reproduce the problem. I successfully displayed PDF file in a new browser tab. Could you please provide a demo project along with reproduction scenario?

Gleb

Hi Gleb ,

I tried on an external project and the expected behavior for opening the file inside the browser is working fine , The issue now is my live application on production
I was expecting the issue because i’m creating FileDescriptor object and adding the byte array to it and then saving it.

I tried to make file upload using cuba file upload tag on the project that currently run on the production
Then try to download the file the same issue happened that the file is downloaded not opened inside the browser

Although the below is logged at the application logs

image

please tell me how to trace this issue and figure out what is the root cause of it.

Hi,

It’s difficult to say what’s wrong without a demo project which reproduces the problem. You can try to debug com.haulmont.restapi.controllers.FileDownloadController#downloadFile. This method is invoked every time you access the file download link.

Gleb