473,386 Members | 1,708 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,386 software developers and data experts.

Can I Response.Redirect to a pdf file on my c: drive?

I have a Crystal reports export that throws the exported pdf file into a
folder c:\reports. The export works fine, but now I need to redirect the
user to that report. Can you please tell me how I can do that?

Thanks,

-Dave
Nov 19 '05 #1
2 5431
http://support.microsoft.com/kb/307603/EN-US/

Hope this helps.

"Dave" <no****@yahoo.com> wrote in message
news:#y*************@TK2MSFTNGP12.phx.gbl...
I have a Crystal reports export that throws the exported pdf file into a
folder c:\reports. The export works fine, but now I need to redirect the
user to that report. Can you please tell me how I can do that?

Thanks,

-Dave

Nov 19 '05 #2
This code works perfectly for me:

Response.ContentType="application/pdf";

Response.AddHeader( "content-disposition","attachment; filename=filename);

FileStream sourceFile = new FileStream("C:\\PDFs\\" + filename,
FileMode.Open);

long FileSize;

FileSize = sourceFile.Length;

byte[] getContent = new byte[(int)FileSize];

sourceFile.Read(getContent, 0, (int)sourceFile.Length);

sourceFile.Close();

Response.BinaryWrite(getContent);

-IFS

"Dave" <no****@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
I have a Crystal reports export that throws the exported pdf file into a
folder c:\reports. The export works fine, but now I need to redirect the
user to that report. Can you please tell me how I can do that?

Thanks,

-Dave

Nov 19 '05 #3

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

Similar topics

4
by: Trigger | last post by:
I'm trying to build a tray for users to download their selected items. I was wondering if anyone knows how to response.redirect a file (for the user to download) and check to see if the download...
13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
4
by: Max Dupenois | last post by:
I've seen numerous articles with similair (similar sp?) titles to this in my search.. unfortunately none of them seem to contain what i want, (or if they do i need someone to point out my stupidity...
6
by: Sam | last post by:
I have some issues with HTTP Headers and I was hoping for some pointers or references to good articles. Here is the problem. I have 6 .aspx pages, each page contains a common .ascx. This ascx...
1
by: Esref DURNA | last post by:
How To Response With dll or exe file ("not inside the aspx page"); its hard to explain but we should do these for earning 5 tera bayt capacity from our harddisks. There is 2 copy for each images...
1
by: Kevin Blount | last post by:
Background: My script is designed to only allow the downloading of a file if a cookie exists to say that someone is logged into my companies site. A colleague set up a test area the extension...
2
by: cchisholm | last post by:
I have a web page in which I am displaying a .pdf file by way of response.redirect. The pdf file is on my machine along with IIS that is running the web page. As soon as I upgraded XP pro to...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
4
by: dasnowball | last post by:
Hi everyone, I'm developing an application using ASP.NET with VB, connected to a SQL Server, running on .NET 2 framework. I am developing a training system where documents are uploaded into the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.