0

I want to save a file on client machine.

i even used the commnad "Path.GetTempPath()" but it gives the address of server's temp folder.

can someone help me?????

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Maidomax
0

C# runs on the web server. It would be pretty dangerous for web applications to just be able to just save files on a client machine whenever they wanted.
You can either prompt the user to click a link, which then lets the user choose where to save the file, or you can stream the file to the browser and set the content type.
There are also COM / ActiveX objects that can save files to the client, but there are browser issues, of course. Anything that hits the client, hits the browser, when you're talking web apps. At the most basic level, the web application does a bunch of stuff on the web server that generates a static file, which is then sent to the browser over http protocol. By the time the browser sees it, the C# is totally done running and the process has completed.

(I'm assuming this is a web application or you wouldn't be having issues with a server, I wouldn't think)

There may be multiple solutions for what you're trying to do; so, what are you really trying to do? :)

0

It really is jus common sense... What would internet look like and how long would it last if just about anybody could save any thing on another person's computer. Common sense tells you that the person has to allow you to save the file on his(or hers) computer (, and where exactly).
Am I not right?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.