2.0 upgrade broke file downloads from websites

J

Jon

Since installing the 2.0 Framework, all of my websites that allow for
report download have broken. These websites generate reports in pdf,
word, or excel content type and then write the content of the file to
the response. Here is an example of the code

dim fileName as String
fileName =
attachmentGenerator.getPDFReport(Request.Params.Item("id"))

Response.ClearContent()
Response.ClearHeaders()

Response.ContentType = "application/pdf"

Response.WriteFile(fileName)
Response.Flush()
Response.Close()
System.IO.File.Delete(fileName)

The sites use various content types, such as excel and word, but all
are broken by the 2.0 update.

I ran aspnet_regiis -u for the 2.0 version on that server to uninstall
the 2.0 asp engine on iis. I then uninstalled the 2.0 framework from
the server. Then I ran aspnet_regiis -i to re-install the 1.1.4
version of the asp.net engine for iis just as a desperate move.

The problem has not gone away. I have a try catch block around this
sample code and no exceptions are appearing.

The client browser, whether on the server or remotely, just opens with
a blank page and no content. It used to automatically open the web
based viewers for pdf, excel, or word.

Thanks for any help you can give me!
 
A

agapeton

That delete makes me feel really weird. You're going to delete the
file when you tell them about it? That's BEFORE they get it... I'm not
sure about the underlying concurrency and locking issues though.
 
P

Patrice

What if you try a sample page that would just write a given text file or
something similar for a start ?

Does it work ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top