cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript code to disable open/save dialog for file attachments

0 Kudos

We have a requirement where we have a standard Fiori application. We have a Tab for Attachments which shows the list of attachments.

We are running the Fiori application on IE.

When we click on the file icon under attachments, the dialog opens up which says Do you want to open or save. Is there any Javascript code to disable the bellow dialog and open the files directly?

We do not want to make the changes in the IE settings.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Puneet,

as far as i know, there is no way to prevent this behavior via JavaScript. Because you don't want to change your IE-settings, you could try to manipulate the HTTP response-header of your attachments.

Sometimes, the headerfield "Content-Disposition" is used, to force a download-popup for particular MIMEs. Maybe you can trace the HTTP traffic and check, if this header is used by your application. Then i would remove this header information of the affected responses with a reverse proxy. An Apache HTTP Server with mod_header will do the trick.

Okay, maybe this approach sounds a bit inconvenient, but i've solved a similar problem on this way.

Alternatively, you could try to enhance your server-side code/oData-Services to avoid the setting of unwanted headerfields.

Regards

Michael

Answers (0)