473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Redirecting to Network file.

Hi,

I would like to redirect my browser to a Network file (not on the Web
Server), whrn a button is clicked.
For example a Excel workbook.

I would like options to open it in Excel, in the Browser or download it to
my local Machine.

I am using VB.NET and ASP.NET

Regards
Tim
Nov 18 '05 #1
3 1181
If is is going to be a File then you can use the File:// protocl tag to
inform IE to open from a file Location. You can directly point to the
Network location provided your users are always going to be mapped to
this particulr location.

(OR)

this is not what you asked for, but you can grant access to the File
Server Share to an account that the ASP.NEt application can impersonate
under. Then you can read from the File Server and send the data as
binary data to the client or you can also create a IIS Virtual Directoy
and use the links to navigate to them. I would use the later.

In Fact to make life easier we had actually installed a web server along
with the file server which does nothing more than serve static files.

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
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


Nov 18 '05 #3
Hi Tim,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If there're anything else we can
help, please feel free to post here. 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

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: DeathStorm | last post by:
How do i redirect to a different page without out changeing the address in the address bar but allowing the title to change?
0
by: Christophe HELFER | last post by:
hi, I have some problem with redirecting input and output from a process. I can only use VB language (sorry...) Situation: I have to use the Cisco Network Registrar (DNS And DHCP server) ...
5
by: darrel | last post by:
I'm trying to set up a usercontrol that I can put on specific pages to authenticate people via their network login on our intranet. I have this in the config file: <authentication mode="Windows"...
6
by: Christophe Helfer | last post by:
hi, I have some problem with redirecting input and output from a process. Situation: I have to use the Cisco Network Registrar (DNS And DHCP server) command line utility as redirecting its...
8
by: Morpheus | last post by:
I am trying to test a function that outputs text to the standard output, presumably using a cout call. I do not have access to the source, but need to test the output. Is this possible? I can...
17
by: mansb2002 | last post by:
Hi, We recently moved our webserver from Win2K to Win2003. The application works fine. Only problem is that when user views a report as a PDF, IE does not show it. The following code is used to...
41
by: amygdala | last post by:
Hello all, I have posted a similar question in comp.lang.php in the past, but haven't had any response to it then. I kinda swept the problem under the rug since then. But I would really like to...
1
by: Perry Langla | last post by:
Hi, I ran across some information about redirecting assembly version. It said you can use a redirect statement in the app.config file. Could someone please help me with this redirect statement....
1
by: barunva | last post by:
Hi All, Can you please answer my following question: I have two web servers; one is based on Linux Operating System and the second one is based on AIX OS, and both are geographically apart,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.