By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,935 Members | 1,563 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,935 IT Pros & Developers. It's quick & easy.

How to open a Snapshot file from ASP.NET

P: n/a
I am working on a ASP.NET application using VB.NET.
I have a function that creates a snapshot file on a separate server
and passes a path back to the webpage. Now I want to display the
snapshot. If I cut and paste the path into the browser it opens
snapshot viewer. Exactly what I want. However, if I
response.redirect to the path, I get a error that the file can not be
found. If I response.redirect to "file:"+path It opens the snapshot
in the browser, however you loose most of the controls in shapshot
viewer. You can no longer print or email from the file menu.

Here is the path that gets generated:

\\WPGA030ADOR1\GPRptSrv\TSWPRDSQL\RptOutput\11-18-04
103139_40904a53_29dc_432f_8f33_322e196ef503.snp

When the redirect happens it shows up in the browser as
http://WPGA030ADOR1/GPRptSrv/TSWPRDS...f99219789a.snp
And
file:\\WPGA030ADOR1\GPRptSrv\TSWPRDSQL\RptOutput\1 1-18-04
103139_40904a53_29dc_432f_8f33_322e196ef503.snp
When I cut and paste IE shows a folder icon in the address bar. When
the redirect happens it shows an IE/HTML page icon, when the second
redirect happens it shows a snapshot file icon?

Any ideas on how to redirect to the file as if you where cutting and
pasting??
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
have you tried to output it to Response.OutputStream?
"Steven Thomas" <st******@gapac.com> wrote in message
news:61**************************@posting.google.c om...
I am working on a ASP.NET application using VB.NET.
I have a function that creates a snapshot file on a separate server
and passes a path back to the webpage. Now I want to display the
snapshot. If I cut and paste the path into the browser it opens
snapshot viewer. Exactly what I want. However, if I
response.redirect to the path, I get a error that the file can not be
found. If I response.redirect to "file:"+path It opens the snapshot
in the browser, however you loose most of the controls in shapshot
viewer. You can no longer print or email from the file menu.

Here is the path that gets generated:

\\WPGA030ADOR1\GPRptSrv\TSWPRDSQL\RptOutput\11-18-04
103139_40904a53_29dc_432f_8f33_322e196ef503.snp

When the redirect happens it shows up in the browser as
http://WPGA030ADOR1/GPRptSrv/TSWPRDS...f99219789a.snp
And
file:\\WPGA030ADOR1\GPRptSrv\TSWPRDSQL\RptOutput\1 1-18-04
103139_40904a53_29dc_432f_8f33_322e196ef503.snp
When I cut and paste IE shows a folder icon in the address bar. When
the redirect happens it shows an IE/HTML page icon, when the second
redirect happens it shows a snapshot file icon?

Any ideas on how to redirect to the file as if you where cutting and
pasting??

Nov 18 '05 #2

P: n/a

Thanks, but I am not sure how to do that do you have an example?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

P: n/a
well...
You can make your page generate pretty much any content when you output it
to HttpResponse.OutputStream (you can get there from
Page.Response.OutputStream). I don't have the example right now, but
HttpResponse.OutputStream is of type Stream (see msdn). It means, you can
use write to it the same way you write to your text file.

In practice you would:

1. Open a stream S to your snapshot (don't forget to use Server.MapPath)
2. Copy the content of the S to Response.OutputStream (use the example of
copying files).
3. Close S
4. You're done.
"Steven Thomas" <st******@gapac.com> wrote in message
news:uv**************@TK2MSFTNGP09.phx.gbl...

Thanks, but I am not sure how to do that do you have an example?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.