Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Creating a downloadable link on my website

Posted on 2008-10-14
5
Medium Priority
?
235 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 400 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 400 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
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.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Suggested Courses
Course of the Month12 days, 10 hours left to enroll

972 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