Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Brandon Gormley6,147 Points
Download Button will only open in browser?
My goal is to click a Download Button which I have made and then have my resume download to the user's computer. Currently it will only open up in the browser.
Anyone know how to fix?
<div class="resume"> <h2>Resume</h2> <p>Please feel free to download my resume below:</p> <a class="resumebutton" href="resume/resume.pdf" download="Resume">Download</a> </div>
Sean T. Unwin28,688 Points
Depending on your web server, you may have to set the Response Headers.
For example, if you are using Apache you may set the following in an
AddType application/octet-stream .pdf
There are other ways to perform essentially the same, i.e. setting the headers, programmatically in whichever language you are using on the server.