cancel
Showing results for 
Search instead for 
Did you mean: 

Download file with Get Stream

jakob_steen-petersen
Active Participant
0 Kudos
216

Hi

I have an oData service that are able to return a file with Get Stream.

I can use the PdfViewer to view the Pdf file in browser. But i would like the system to just Download the file to PC. Also i have the need to pass all filetypes (Excel, Msg, Word etc.).

Any ideas on how i can make it just Download?

var opdfViewer = new PDFViewer(); 
this.getView().addDependent(opdfViewer); 
var sServiceURL = this.getView().getModel().sServiceUrl; 
var sSource = sServiceURL + "/FileSet(Equipment='1234',AttachmentID='25')/$value";
opdfViewer.setSource(sSource); opdfViewer.setTitle( "pdf"); opdfViewer.open();

Accepted Solutions (1)

Accepted Solutions (1)

jklimes
Explorer
0 Kudos

Hello Jakob,
If you navigate to adress instead of openning it in PDFViewer, in your case -> sServiceURL + "/FileSet(Equipment='1234',AttachmentID='25')/$value";

It should start downloading your file.

jakob_steen-petersen
Active Participant
0 Kudos

Perfect thanx!

Answers (0)