Saving a file in a specific Directory

  • Thread starter Thread starter Chicagoboy27
  • Start date Start date
C

Chicagoboy27

All I am trying to specify a location for the file to be saved in.
currently I have a process that get the location of the file and then
prompts the user to save it in a directory. I am wondering if it is
possible to specify that directory on their system. Our clients would
have this directory on their system already....

here is the code that I am currently using

Response.ContentType = "application/zip";
Response.AppendHeader("Content-Disposition", "attachment;
filename=myzipfile.zip");
Response.WriteFile(@"C:\somedirectoy\somefile.zip");
Response.Flush();

Thanks in advance
 
I guess another question would be is there a way totemporarily override
the default location the browser looks to save things in.?
 
Hi,
I guess another question would be is there a way totemporarily override
the default location the browser looks to save things in.?

No, the default location for the files is purely client-side. The server
cannot specify anything. Actually, this is better this way, or else you
could imagine using that for malicious actions (of course it still
request a user interaction, but users are so naive sometimes...)

Usually, the browser starts by displaying a default location, and later
displays the last location where the user saved a file. Of course it may
vary from browser to browser.

HTH,
Laurent
 
Thanks for your reply. That is what I was figuring due to security
reasons. Thanks again for taking the time to answer.
 
Back
Top