Jump to content

Download boxes


Callum

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

thanks :), is the type necessary though?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...