473,508 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Downloading fails (pdf) on OPEN button, not via save as...


I have a problem with downloading a PDF by using the response object.

A part of it:
..Response.Clear()
..Response.ContentType = sFileType
..Response.AppendHeader("Content-Disposition", "attachment; filename=" &
sFileNameOut)
..Response.AppendHeader("Content-Length", fs.Length.ToString)
..Response.AppendHeader("Content-Transfer-Encoding", "BINARY")
..Response.Flush()

And a binary data loop.
This does work fine for several purposes but for this PDF it seems to fail
but ONLY when using the OPEN button.
When i choose for save as and open it then it shows fine.
I traced the log using a filemon tool and it seems IE clears the cache and
removes the file before the Adobe reader can open it.

It's odd, my simple test app using the same code runs fine.

I can't find the problem, the PDF is downloaded fine, before i choose OPEN i
located the file in the IE download folder and tried to open it, it shows
fine.

???

Nov 19 '05 #1
4 1630
Common fellas!

I'm looking but i can't find it.
I have the idea this is a forms authenticate issue.
I have the feeling MSIE does not get a authenticate during this download and
removes the file right away.

Really need some help.

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...

I have a problem with downloading a PDF by using the response object.

A part of it:
.Response.Clear()
.Response.ContentType = sFileType
.Response.AppendHeader("Content-Disposition", "attachment; filename=" &
sFileNameOut)
.Response.AppendHeader("Content-Length", fs.Length.ToString)
.Response.AppendHeader("Content-Transfer-Encoding", "BINARY")
.Response.Flush()

And a binary data loop.
This does work fine for several purposes but for this PDF it seems to fail
but ONLY when using the OPEN button.
When i choose for save as and open it then it shows fine.
I traced the log using a filemon tool and it seems IE clears the cache and
removes the file before the Adobe reader can open it.

It's odd, my simple test app using the same code runs fine.

I can't find the problem, the PDF is downloaded fine, before i choose OPEN
i
located the file in the IE download folder and tried to open it, it shows
fine.

???

Nov 19 '05 #2
(bump!)

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...
Common fellas!

I'm looking but i can't find it.
I have the idea this is a forms authenticate issue.
I have the feeling MSIE does not get a authenticate during this download
and removes the file right away.

Really need some help.

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...

I have a problem with downloading a PDF by using the response object.

A part of it:
.Response.Clear()
.Response.ContentType = sFileType
.Response.AppendHeader("Content-Disposition", "attachment; filename=" &
sFileNameOut)
.Response.AppendHeader("Content-Length", fs.Length.ToString)
.Response.AppendHeader("Content-Transfer-Encoding", "BINARY")
.Response.Flush()

And a binary data loop.
This does work fine for several purposes but for this PDF it seems to
fail
but ONLY when using the OPEN button.
When i choose for save as and open it then it shows fine.
I traced the log using a filemon tool and it seems IE clears the cache
and
removes the file before the Adobe reader can open it.

It's odd, my simple test app using the same code runs fine.

I can't find the problem, the PDF is downloaded fine, before i choose
OPEN i
located the file in the IE download folder and tried to open it, it shows
fine.

???


Nov 19 '05 #3
Hello Edwin,

we have a similar problem at our customers web server. :-( Were you able to
solve your problem? ;-)

Regards,
Alex

"Edwin Knoppert" wrote:
(bump!)

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...
Common fellas!

I'm looking but i can't find it.
I have the idea this is a forms authenticate issue.
I have the feeling MSIE does not get a authenticate during this download
and removes the file right away.

Really need some help.

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...

I have a problem with downloading a PDF by using the response object.

A part of it:
.Response.Clear()
.Response.ContentType = sFileType
.Response.AppendHeader("Content-Disposition", "attachment; filename=" &
sFileNameOut)
.Response.AppendHeader("Content-Length", fs.Length.ToString)
.Response.AppendHeader("Content-Transfer-Encoding", "BINARY")
.Response.Flush()

And a binary data loop.
This does work fine for several purposes but for this PDF it seems to
fail
but ONLY when using the OPEN button.
When i choose for save as and open it then it shows fine.
I traced the log using a filemon tool and it seems IE clears the cache
and
removes the file before the Adobe reader can open it.

It's odd, my simple test app using the same code runs fine.

I can't find the problem, the PDF is downloaded fine, before i choose
OPEN i
located the file in the IE download folder and tried to open it, it shows
fine.

???



Dec 6 '05 #4
It was related how i did the forms authenticate.
the download procedure must clear headers and contents as well.
Seems to much session data influenced the result, the file was removed right
after dl.

Add:
Response.ClearHeaders
Response.ClearContents
"Alexander Greiner" <Al**************@discussions.microsoft.com> schreef in
bericht news:6A**********************************@microsof t.com...
Hello Edwin,

we have a similar problem at our customers web server. :-( Were you able
to
solve your problem? ;-)

Regards,
Alex

"Edwin Knoppert" wrote:
(bump!)

"Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
news:43***********************@text.nova.planet.nl ...
> Common fellas!
>
> I'm looking but i can't find it.
> I have the idea this is a forms authenticate issue.
> I have the feeling MSIE does not get a authenticate during this
> download
> and removes the file right away.
>
> Really need some help.
>
>
>
> "Edwin Knoppert" <ne**@hellobasic.com> schreef in bericht
> news:43***********************@text.nova.planet.nl ...
>>
>> I have a problem with downloading a PDF by using the response object.
>>
>> A part of it:
>> .Response.Clear()
>> .Response.ContentType = sFileType
>> .Response.AppendHeader("Content-Disposition", "attachment; filename="
>> &
>> sFileNameOut)
>> .Response.AppendHeader("Content-Length", fs.Length.ToString)
>> .Response.AppendHeader("Content-Transfer-Encoding", "BINARY")
>> .Response.Flush()
>>
>> And a binary data loop.
>> This does work fine for several purposes but for this PDF it seems to
>> fail
>> but ONLY when using the OPEN button.
>> When i choose for save as and open it then it shows fine.
>> I traced the log using a filemon tool and it seems IE clears the cache
>> and
>> removes the file before the Adobe reader can open it.
>>
>> It's odd, my simple test app using the same code runs fine.
>>
>> I can't find the problem, the PDF is downloaded fine, before i choose
>> OPEN i
>> located the file in the IE download folder and tried to open it, it
>> shows
>> fine.
>>
>> ???
>>
>>
>>
>
>


Dec 6 '05 #5

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

Similar topics

0
976
by: Edwin Knoppert | last post by:
I have not much good response lately on the ASP.NET website, so i'll try it here. I have a problem with downloading a PDF by using the response object. A part of it: ..Response.Clear()...
15
13255
by: Mark C | last post by:
All, I have exhaustingly been looking through the newsgroups in search of a way to systemically output an Access 97 report to a pdf file using the full version of Adobe Acrobat. I want the user...
7
8822
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
1
2157
by: Marina | last post by:
Hi, I have the following code to prompt the user for a download: Response.Clear() Response.ContentType = "application/octet-stream" Response.AppendHeader("Content-Disposition",...
1
1112
by: C | last post by:
Hi, I generate a report in crystal and output it as a PDF. I then add some details to my HTTP Headers so to download the file. When the user clicks on Download button I update some server...
2
1432
by: Matt Mercer | last post by:
Hi all, Well, thanks to some smart/helpful people here my upload and download section of my website works great! I am allowing users to upload directly into the SQL database but files cannot...
0
1732
by: brian.fairchild | last post by:
I have a downloader page in my asp.net application that looks at a session variable to get the path to the file, checks it then downloads it using the Response object. When the "File Download"...
9
4945
by: AES | last post by:
I fairly often make PDF copies of web pages or sites by copying the web page link from the web page itself and pasting it into the Acrobat 7.0 Standard "Create PDF From Web Page" command. (Not...
2
1486
by: comick | last post by:
Hello all, i have a asp.net c# web app 2.0 I have a pdf generation with a third part sw, but i cant download pdf in a new window, from a folder inside my web site. The code i try to use is...
0
7127
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
7331
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,...
1
7054
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...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.