ASP download for PDF files not working

A

Astra

Hi All

The following ASP routine allows me to force a PDF file to download rather
than show up in IE:

Response.ContentType = "application/asp-unknown" ' arbitrary

Response.AddHeader "content-disposition","attachment; filename=" & theFile

Set adoStream = Server.CreateObject("ADODB.Stream")

adoStream.Open()

adoStream.Type = 1

adoStream.LoadFromFile(thePath)

Response.BinaryWrite adoStream.Read()

adoStream.Close

Set adoStream = Nothing

Response.End

This works fine for 250KB - 500KB PDF files, but I've just uploaded a 6MB
file and it simply doesn't seem to do anything. The code does nothing which
in turn means that the standard Save dialogue box can't find the file.

Any ideas on what I can do?

Rgds

Robbie
 
J

Jeff Cochran

Hi All

The following ASP routine allows me to force a PDF file to download rather
than show up in IE:

Response.ContentType = "application/asp-unknown" ' arbitrary

Response.AddHeader "content-disposition","attachment; filename=" & theFile

Set adoStream = Server.CreateObject("ADODB.Stream")

adoStream.Open()

adoStream.Type = 1

adoStream.LoadFromFile(thePath)

Response.BinaryWrite adoStream.Read()

adoStream.Close

Set adoStream = Nothing

Response.End

This works fine for 250KB - 500KB PDF files, but I've just uploaded a 6MB
file and it simply doesn't seem to do anything. The code does nothing which
in turn means that the standard Save dialogue box can't find the file.

Any ideas on what I can do?

How do you know it does nothing?

Jeff
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top