473,408 Members | 2,032 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,408 software developers and data experts.

ASP download for PDF files not working

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
Jul 19 '05 #1
2 1707
On Fri, 23 Jul 2004 11:49:56 +0100, "Astra" <in**@NoEmail.com> wrote:
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
Jul 19 '05 #2
Hi Jeff

Sorry for the delay in coming back to you.

Basically I know it isn't reading the file in properly, because when the
download is trying to initiate I can see that it doesn't know what the
filename is and therefore says that it can't find the path.

It can't be a fault of the code, because the exact same code works if the
file is smaller.

Rgds

Laphan
Jeff Cochran <je*********@zina.com> wrote in message
news:41****************@msnews.microsoft.com...
On Fri, 23 Jul 2004 11:49:56 +0100, "Astra" <in**@NoEmail.com> wrote:
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
Jul 19 '05 #3

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

Similar topics

3
by: Matthew Moran | last post by:
I am creating a series of downloadable articles, career tools, spreadsheets, etc. However, some of the content is for "registered" guest. The registrants are stored in a database and logon. I...
5
by: Thomas Andersson | last post by:
Hi, I am trying to find a working solution for download of large files (400-800 MB)... But this seems almost impossible to find a working example. I have tried Response.Transmitfile, this...
2
by: Grant | last post by:
Hi, I'm trying to download files using asp.net (vb) and it seems to take forever to actually bring up the Save As dialog box. The files are Academic Software Downloads so are quite large in...
0
by: Thomas Andersson | last post by:
Hi, I am trying to find a working solution for download of large files (400-800 MB)... But this seems almost impossible to find a working example. I have tried Response.Transmitfile, this...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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,...
0
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...

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.