Response.TransmitFile() with UNC share (ASP.NET)
- by frankadelic
In the comments of this page:
http://msdn.microsoft.com/en-us/library/12s31dhy.aspx
..it says that TransmitFile() cannot be used with UNC shares. As far as I can tell, this is the case; I get this error in Event Log when I attempt it:
TransmitFile failed. File Name: \\myshare1\e$\file.zip, Impersonation Enabled: 0, Token Valid: 1, HRESULT: 0x8007052e
The suggested alternative is to use WriteFile(), however, this is problematic because it loads the file into memory. In my application, the files are 200MB, so this is not going to scale.
Is there a method in ASP.NET for streaming files to users that's:
scalable (doesn't read entire file into RAM or occupy ASP.NET threads)
works with UNC shares
Mapping a network drive as a virtual directory is not an option for us. I would like to avoid copying the file to the local web server as well.
Thanks