开发者

Save file locally from asp.net without "save as.."? Is ActiveX the only solution?

开发者 https://www.devze.com 2023-03-10 02:21 出处:网络
I\'m in the process of building a web application in ASP.NET MVC C# (including ajax/jquery) and have to save a file locally to the client\'s hard drive.

I'm in the process of building a web application in ASP.NET MVC C# (including ajax/jquery) and have to save a file locally to the client's hard drive.

I have another application that polls a directory for new files, so it's essential the files from the website ends up at that location so therefore showing a "save as.." won't work.

What alternatives do I have? (Sadly I can't rewrite that external application to work in any other way.) Should I write the w开发者_Python百科eb application in silverlight instead? Should I use an ActiveX object? ActiveX feels so 1995 though.. Are there any other variants nowadays?


I'll vote for Silverlight solution.

But instead of developing your site entirely with Silverlight, just write a small and hidden Silverlight component that would receive a remote file location and stores it in user's local file system.

Check this other answer in Stackoverflow:

  • Does Silverlight 3 have access to local file system, Open Excel, and print reports?

And watch this movie:

  • http://www.silverlight.net/learn/videos/all/local-file-access/


This would be a security feature in the browser. It is not acceptable to give a website access to a local folder without some sort of dialog. ActiveX may work, because it is much less secure.

Can you not find a different approach?

In the past I have made a local application in C# that simply uses HTTP requests to download files in a client-server model.

0

精彩评论

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

关注公众号