开发者

Download files using javascript and webservices

开发者 https://www.devze.com 2023-04-04 10:13 出处:网络
I need to download a list of files from an html page inside a public portal. Files are in folders in an intranet server.

I need to download a list of files from an html page inside a public portal. Files are in folders in an intranet server.

From the html page, using javascript I call an asp.net webservice that reads a file, and sends its content as开发者_如何学Python a byte array.

How can I download/show that file using that byte array from the javascript function?

Thanks, Fabio


It isn't going to work exactly as you describe it. You can't save a byte array to a file from javascript.

What you can do is to link to a "service" that returns the file as its response with the proper headers to cause the browser to open a save dialog.

0

精彩评论

暂无评论...
验证码 换一张
取 消