Unable to change file download content-disposition header

Unable to change file download content-disposition header

  

Hi team,


I am unable to change the header of my download file. I want to set the content-disposition header of my file but outsystems is not allowing. using Add_Header action raises exception that content-disposition is already set.

Any idea on how can we override the Content-Disposition that outsystems add while downloading file

Hi Arj,

Are you getting file from REST Api? why do you want to change Conten-Disposition. And where did you try to change Content-Disposition.


Thanks,

Balu

Balu wrote:

Hi Arj,

Are you getting file from REST Api? why do you want to change Conten-Disposition. And where did you try to change Content-Disposition.


Thanks,

Balu


yes, I am getting excel file as a binary content from Rest API which I am passing to download widget with proper MIME type. But, it is not getting download on IPAD, while it works in Desktop

EDIT 1 - The reason I want to change the disposition header is that i want to set it as INLINE to check if that will work, currently its attachment.


EDIT 2 - To test the excel getting generated from REST API, I downloaded it in IPAD through my mail client. But, there also it didn't opened. I checked this download on Safari and Chrome in IPAD but it didn't work. For desktop, it works fine.

Hi Arj,

Can you verify if your file open as popup, because iphone and ipad safari browser block popups, so u need to enable it.

Settings - Safari - Block Pop-ups -> enable


Thanks,

Balu 

Balu wrote:

Hi Arj,

Can you verify if your file open as popup, because iphone and ipad safari browser block popups, so u need to enable it.

Settings - Safari - Block Pop-ups -> enable


Thanks,

Balu 

Hi Balu,

No, it's not opening as a popup but gets opened in a new tab for previewing the file.


yes, i believe new window also blocked (because its opening programmatically not by manual), can you verify the setting i mentioned above, and after try download file, just to confirm the situation.


Thanks,

Balu

Hi Balu,

i checked popup windows are not blocked in the Safari settings. Further investigation on this issue, I found that the Rest API is generating excel using Open XML. 

There are some sources that suggest Strict Open XML is not supported on IPAD

Also, I created excel file in .NET using Open XML with .NET Dataset object and this file also didn't open in iPAD. But with EPPlus library it was working fine. Something is problematic with OpenXML when using .Net Dataset object for excel export.