Jump to content

Download boxes


Callum
 Share

Recommended Posts

You know when you download a file off of the internet, a download box appears, how do you make one of them? woud it be in html?If so could somebody direct me to a few tutorials in how to make a download boxThanksCallum

Link to comment
Share on other sites

Sorry for sounding stupid,but would it work with something like a Word document or an Excel spreadsheet? as I don't want the browser rendering these,.I want the the user to have to download it or open it so it opens in the appropriate the office based programThanks Callum

Link to comment
Share on other sites

Guest FirefoxRocks
<a href="fileNameOfTheFile.FileExtension" type="application/octet-stream"> Link text </a>

So with a real file...

<a href="mortgages.xlsx" type="application/octet-stream"> Mortgages Spreadsheet </a>

Hope this helps.

Link to comment
Share on other sites

Why? Works fine for me without the attribute - browsers just read the content-type header.

Link to comment
Share on other sites

Why? Works fine for me without the attribute - browsers just read the content-type header.
I think this is a matter of additional settings.If you have an in-browser reader, IE will attempt to use it unless the Content-disposition header says otherwise. If you don't, there's always a download box. I'd personally never set Content-disposition though. Why not allow the user to directly read the file if they can?
Link to comment
Share on other sites

Guest FirefoxRocks

Well if you want the user to download the PDF, or Excel spreadsheet or whatever instead of it opening in Adobe Reader or Google Docs, then the way to do it is through the type attribute.

Link to comment
Share on other sites

Well if you want the user to download the PDF, or Excel spreadsheet or whatever instead of it opening in Adobe Reader or Google Docs, then the way to do it is through the type attribute.
OK, now... why would you want to deny the user this right?And I'm not sure about the type attribute, but setting Content-disposition is sure to work everywhere regardless of markup and the user agent.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...