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

Force download of pdf file

How do i force a user to download from a hyperlink as adobe pdf file, it
loads up in a new window and I need them to download it, or at least give
them the choice to download it.
Don.
Jul 19 '05 #1
4 6752
Hi Don,
http://www.aspfaq.com/show.asp?id=2161
Ray at work

"Don Grover" <sp******@assoft.com.au> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
How do i force a user to download from a hyperlink as adobe pdf file, it
loads up in a new window and I need them to download it, or at least give
them the choice to download it.
Don.

Jul 19 '05 #2
Thanks Ray
With 40 billion pages on the web i am finding hard remembering where they
all are. 8-)
Don


"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:et**************@TK2MSFTNGP09.phx.gbl...
Hi Don,
http://www.aspfaq.com/show.asp?id=2161
Ray at work

"Don Grover" <sp******@assoft.com.au> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
How do i force a user to download from a hyperlink as adobe pdf file, it
loads up in a new window and I need them to download it, or at least give them the choice to download it.
Don.


Jul 19 '05 #3
<a href="download.asp?FileName=aa.pdf">FileDown</a>
<!-- download.asp //-->
<%
Response.ContentType = "application/unknown"

Response.AddHeader "Content-Disposition","attachment; filename="&
Request("FileName")

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

objStream.Open

objStream.Type = 1

objStream.LoadFromFile Server.MapPath("/root/pdf/")&"\"& Request("FileName")

download = objStream.Read

Response.BinaryWrite download
Set objstream = Nothing
%>

Jul 19 '05 #4
Those that cannot be found at www.aspfaq.com can be found at www.google.com.
:]

Ray at work

"Don Grover" <sp******@assoft.com.au> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Thanks Ray
With 40 billion pages on the web i am finding hard remembering where they
all are. 8-)
Don

Jul 19 '05 #5

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

Similar topics

2
by: Matthew Sims | last post by:
Is it possible to force a download without using the readfile function? My website setup consists of my server that serves the web pages plus a high-speed file server elsewhere on the internet...
1
by: Navin | last post by:
hi, guys i am using the following code to force a file download dialog in asp Response.ContentType = "application/vnd.ms-excel" response.AddHeader "content-disposition","attachment; filename="...
2
by: Guoqi Zheng | last post by:
Dear Sir, I made a force download in ASP. For other types of file, everything works ok. but for .txt, .html this kind of file. it always return an error, file not found. can someone point out...
1
by: Navin | last post by:
hi, guys i am using the following code to force a file download dialog in asp Response.ContentType = "application/vnd.ms-excel" response.AddHeader "content-disposition","attachment; filename="...
7
by: tma | last post by:
How can I force a file to be downloaded to the client when the click a link button, rather than show the file in the browser window (or another window). I want the user to be prompted to open or...
13
by: ron1972 | last post by:
Hi I have a large pdf file that if I create an anchor link to, the browser will try to open the file, which takes quite a long time. Is there a way to force the browser to download the file rather...
0
by: comp.lang.php | last post by:
I have a form that when you click the "Generate Report" submit button, it will force download a CSV file, required for this project. On the very same page you also have a "Search" submit button,...
3
by: Bouffa | last post by:
Hello everyone, I suppose you all know force-download scripts. The problem is that these scripts don't allow files to be splitted when downloading them via a download manager. I've found a...
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
1
by: Zabivb | last post by:
I have a html file on my server, if a user clicks on a link it should download, but instead it opens up in browser window coding for downloading <?php echo $todayis = date("l, F j, Y.") ; ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.