| | |
save file on client machine
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
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?
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?
Google is your friend. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit http://www.kaelisspace.com/
Bored? Visit http://www.kaelisspace.com/
![]() |
Similar Threads
- Launching Sound Recorder and Auto-Save file (PHP)
- Windows programming - C - Save file function (C++)
- Winsock Send File To Client Help (C++)
Other Threads in the C# Forum
- Previous Thread: How to randomize music tracks like a CD player
- Next Thread: A c++ related blog...
| Thread Tools | Search this Thread |
.net access algorithm array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum event eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net httpwebrequest image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql mysql.data.client operator path photoshop php picturebox pixelinversion post programming radians regex remoting resourcefile richtextbox server sleep socket sql statistics stream string study system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml





