I'm relatively new to all this so go slow. But what I'm trying to do is have a button where the user can click it and download a file from my site to their computer. I don't know if you need a script to do this or if their is some form command that I'm missing, this is the current code that I have...

<input type="button" value="Download" onClick="document.location='myfile.pdf'">

Problem is when people click the "Download" button all that happens is the PDF is displayed, they can then save it manually if they want. However what I'm wanting it to do is when the user clicks the button it offers them the option to "View or Save As". As I write this it does sound more like a script than form code, however I thought I'd check with the pro's before I begin my goose chase.

Member Avatar for diafol

You have posted to a php forum. You need the javascript forum. If you don't know which language you're using, I don't fancy your chances. :) Anyway, an user's browser may stop you messing with this stuff.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.