Solved

Creating a downloadable link on my website

Posted on 2008-10-14
5
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

      Install BugTracker on Windows 2008 server Step 1:  Install windows 2008 server 32 bit OS and configure IIS. Step 2:  Install SQL server ( SQL server 2005 or SQL server 2005 Express edition. The installer for 2008  version isn’t very f…
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
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 custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

623 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