Download file from webservice - in ASP.NET site

后端 未结 4 2429
没有蜡笔的小新
没有蜡笔的小新 2021-02-20 14:00

I want to push a file to the browser from a website using a webservice. I\'m currently reading the file into a base64 byte array, and returning that from the webservice. This w

4条回答
  •  清酒与你
    2021-02-20 14:27

    It really depends on the interface to your webservice. Ie SOAP, REST, ASPX.

    One thing you can try is to change the content-type in your Response to "Application/octet-stream". Or something similar to tell the receiver the MIME type.

    If your using WCF rest you can use Stream as a return type on the web service.

提交回复
热议问题