session101
Member
- Joined
- May 10, 2006
- Messages
- 23
I have a web app that I download file via the browser using this code:
Response.Clear();
Response.AddHeader("Content-Disposition",
"attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.Flush();
Response.WriteFile(file.FullName);
Response.End();
This works fine when the file is not opened by someone; otherwise, if a user has the file open on his machine, the web app will not launch the writefile function stating "file is used by another process". Is there a way to launch the file in read-only even though the file is already launched on a local client pc? TIA.
Response.Clear();
Response.AddHeader("Content-Disposition",
"attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/vnd.ms-excel";
Response.Flush();
Response.WriteFile(file.FullName);
Response.End();
This works fine when the file is not opened by someone; otherwise, if a user has the file open on his machine, the web app will not launch the writefile function stating "file is used by another process". Is there a way to launch the file in read-only even though the file is already launched on a local client pc? TIA.