Skip to Content

Setting header Content-Disposition to the model

Feb 01 at 10:22 AM


avatar image

Hi All,

I want to display PDF in sap.m.PDFViewer control, for which i want to set the header of the model:

this.oModel.setHeaders({ "Content-Disposition": "inline" });

I bind this model to my fragment where my PDFViewer control is present.

However, in the network calls, i dont see the "Content-Disposition" header getting passed.

Also, when I make a call from controller, i see the "Content-Disposition" header getting passed in the Request headers.

I have also tried adding the header in the manifest.json under data source but nothing helps.

Where am i going wrong?

var oFileUploadConsentFragment = sap.ui.xmlfragment("myfragment", this);
	var sSrcPath = "myServiceURL" + "/Attachments('IdOfMyAttachment')/$value";
var oJsonData = {
				"Attachment": sSrcPath
var oConsentManagementModel = new sap.ui.model.json.JSONModel();	oConsentManagementModel.setData(oJsonData);
this.oFileUploadConsentFragment.setModel(oConsentManagementModel, "oJsonModel");
				"Content-Disposition": "inline"

XML Fragment:
<PDFViewer source="{oJsonModel>/Attachment}"></PDFViewer>
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers