3

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 web application in silverlight instead? Should I use an ActiveX object? ActiveX feels so 1995 though.. Are there any other variants nowadays?

tereško
  • 58,060
  • 25
  • 98
  • 150
user778929
  • 33
  • 5

2 Answers2

2

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:

And watch this movie:

Community
  • 1
  • 1
Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206
0

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.

Wouter Simons
  • 2,856
  • 1
  • 19
  • 15
  • There will be a large user base on this application so I kind of have to go the website-route instead of installing windows apps for everyone. This small issue with saving a file to a folder is only 1% of the whole application, the rest of the functionality will work perfectly as a web application so I don't want to give up on the website :) – user778929 Jun 01 '11 at 11:37