View returned file from Webservice method

Posted by gafda on Stack Overflow See other posts from Stack Overflow or by gafda
Published on 2010-04-15T15:26:41Z Indexed on 2010/04/15 15:53 UTC
Read the original article Hit count: 235

Filed under:
|
|
|
|

I already have a method in my webservice that returns a byte[] containing only the bytes of the file downloading. The invocation is something like:

http://www.mysite.com/myWebservice.asmx

with:

string fileId = "123"; bytes[] fileContent = myWebservice.Download(fileId);

What I wanted to do is be able to invoke this method or other (to be made) on a aspx webpage and be able to open a browser window containing the real content of the file.

i.e. Most files are TXT and PDF. (Assuming the client has the PDF plugin that alows him\her to view PDF's on the browser.)

© Stack Overflow or respective owner

Related posts about webservice

Related posts about aspx