Hi Tim,
As for the problem on retrieve a Network file and write down to the
response stream, do you mean the file on a remote machine and can access
via UNC path like \\servername\sharedfolder\filename?
This is ok in asp.net, we can just use the Response.WriteFile method to
write a file to response stream via a UNC path. Or use the System.IO api to
retrieve the file into a stream and write it into the Response 's
OutputStream.
For example:
private void Page_Load(object sender, System.EventArgs e)
{
Response.ContentType = "Application/vnd.ms-excel";
string FilePath = @"\\servername\tempshare\test.xls";
Response.WriteFile(FilePath);
Response.End();
}
Here are the kb articles on write binary files to response:
#HOW TO: Write Binary Files to the Browser Using ASP.NET and Visual C# .NET
http://support.microsoft.com/?id=306654
#HOW TO: Write Binary Files to the Browser Using ASP.NET and Visual Basic
..NET
http://support.microsoft.com/?id=307603
#The key point is that access a remote file need the asp.net process run
under a appropriate account, by default the local MACHINE\ASPNET account
won't work. One way it to use impersonate the asp.net with a powerful
domain account or a mapped local account on both local and remote machine.
As for impersonate, you can refer to the followinng kb article:
#INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/?id=306158
Hope helps. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx