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

  • Thread starter Thread starter Edwin Knoppert
  • Start date Start date
E

Edwin Knoppert

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.

???
 
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.
 
(bump!)

Edwin Knoppert said:
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.
 
Hello Edwin,

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

Regards,
Alex
 
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
 
Back
Top