473,396 Members | 1,891 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.

Adobe PDF and IE caching problem ASP.Net C#

Hi Everyone,

I have a C# ASP.Net 1.1 web application that offers the feature to download the reports that we generate into a PDF file. When the Open/Save As dialog box appears, if you click the Save button, the PDF is saved successfully. However, if you click the Open button and you have the following system configuration:

Internet Explorer 6 with Win2000 or WinXP Operating System

You get the following error message in Adobe Reader: "There was an error opening this document. This file cannot be found." The following is the current code that I have been playing around. Basically it is a collection of all the items I found on forums put together.

Response.Clear();
Response.Cache.SetCacheability(HttpCacheability.Pr ivate);
Response.Expires = -1;
Response.Buffer = false;
Response.AddHeader("Pragma", "public");
Response.AddHeader("Expires", "0");
Response.AddHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0;");
Response.AddHeader("Cache-Control", "public");
Response.AddHeader("Content-Description", "File Transfer");
Response.AddHeader("Content-Type", "application/pdf");
Response.AppendHeader("content-disposition","attachment; filename=" + result + GlobalFunctions.GetDateFileName() + ".pdf");
Response.ContentType = "Application/pdf";
Response.WriteFile(rv.getFullPath);
Response.End();


For the record, the control "rv" is the Report Viewer control I created to interface with SQL Reporting Services. The filename and path that is created does not contain spaces. Any help with this matter would be greatly appreciated.

Thanks.
Dec 17 '07 #1
1 2789
kenobewan
4,871 Expert 4TB
I don't believe that this is a caching problem. Either you can't open the document unless it is saved first or it may be a postback problem.
Dec 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Hank Reed | last post by:
I have been using the ShellExecute command for about a year to print out a list of PDF files. It's a great capability. Of course, the documents are actually printed by the Adobe application. We...
1
by: JohnC | last post by:
I have this exact same scenario. It is new and seems to be related to when we installed Adobe 7.0 Standard/Professional. We have an MDB on a LAN file server. Using Access 2K and Windows 2K. ...
2
by: Andre L via AccessMonster.com | last post by:
We run numerous Access reports which we auto export as .rtfs to a share. We also have numerous Excel sheets. Each month 10 or more of these reports are combined into deprtmental monthly packets. ...
6
by: jdph40 | last post by:
We recently had to upgrade the computers in our company. Now our office's website on our company intranet no longer recognizes reports saved in snapshot format. We get an error message that the...
1
by: MuZZy | last post by:
Hi, I just wonder if someone has any idea where i could get description of Adobe SDK functions translated to C#/VB.NET? The problem is this: we have an C#/VB.NET app which uses Acrobat COM...
0
by: s.danyal.k | last post by:
Hi All, I have made an application that loads an Adobe Acrobat file and shows it. For this I ve used Adobe ActiveX Control available in C#. Heres a sample code. I am adding the control...
0
by: Hank | last post by:
We have been printing pdf files through Adobe, from Access for several years. Adobe version 5.0 is currently installed. Recently we have received PDF files that were created under the Adobe 7.0...
10
by: Jules Winfield | last post by:
Guys, I've been designing applications for the financial services industry using MSFT technologies for many years (Win32 API, MFC, and now .NET WinForms). All applications are Internet-based,...
2
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a server 2008 IIS 7.0 with indexing service installed. I have created the catalog and have a test page using these posts:...
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: 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:
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...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.