Solved

Creating a downloadable link on my website

Posted on 2008-10-14
5
224 Views
Last Modified: 2012-05-05
I have a fillable PDF file that I would like to offer as a download on my website...I need to create a link that when clicked will prompt the user to download the file.
0
Comment
Question by:felkamau
5 Comments
 
LVL 19

Expert Comment

by:erikTsomik
ID: 22711123
JUst do this
<a href="http://domainname/filename.pfd">Download Me</a>
0
 

Author Comment

by:felkamau
ID: 22716714
this only opens the pdf...I need to force a download
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 100 total points
ID: 22717956
do you use any SERVER Side scripting in your website?  like PHP/ASP/JSP etc.,?
0
 
LVL 3

Assisted Solution

by:dipakdave1983
dipakdave1983 earned 100 total points
ID: 22718512
Well, you have to explicitely set Header to download using appropriate syntex of your webpage.

Content-Type: application/force-download

So Trick is 1) read entire file as .bin 2) clear the response stream ( it will clear some default contents such as <html contenttype.....>3) set content type as above into HEADER  and  inject .bin file contents to output

example for PHP :
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=\"".basename($file)."\";" );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($file));
readfile("$file");

0
 

Accepted Solution

by:
felkamau earned 0 total points
ID: 23045039
I saved it as a zip file...problem solved
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction (All good things must come to an end (http://en.wikipedia.org/wiki/All_Good_Things...)) The original MySQL API (http://php.net/manual/en/book.mysql.php) has gone away, deprecated by PHP in Version 5.5, and removed from PHP in all cur…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now