开发者

Programmatic download of a file on Web server

开发者 https://www.devze.com 2023-02-02 04:04 出处:网络
I am having some files on IIS web Server which I want to download using javascript/JSP or batch script.For example I am having a file with url http://10.1.25.开发者_运维知识库147/repapp/20101229/bal.t

I am having some files on IIS web Server which I want to download using javascript/JSP or batch script.For example I am having a file with url http://10.1.25.开发者_运维知识库147/repapp/20101229/bal.txt . When I open the file in browser it ask me interactively to save the file.What I want is that it should download this file to client pc using some script.

Thanks


If you're asking if you can force a file to be downloaded to a client's computer without asking permission from the client, then I'm going to say that this isn't doable (and hope that nobody proves me wrong).

The best you can do is provide the browser with the proper headers on the download to suggest what it should do (the type of the response, a suggested name of the file, etc.). However, it's up to the settings in the user's browser as to what it will automatically do with that information and whether or not it will permit the download.

0

精彩评论

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

关注公众号