3

I'm trying to access a document template (.dot) that's linked from a company portal, using chrome. When I click on the link, the browser shows me a bunch of garbage. Is there a setting to force chrome to download this type of file and open it in word?

Example of garbage:

enter image description here

Jibby
  • 850
  • 1
  • 9
  • 21
  • 2
    You pass a `Content-Disposition` header with the `attachment` parameter as noted in [RFC 6266](https://tools.ietf.org/html/rfc6266). [Reference](http://www.iana.org/assignments/cont-disp/cont-disp.xhtml). This [answer](http://stackoverflow.com/questions/1012437/uses-of-content-disposition-in-an-http-response-header) explains the concept in more detail. An example of this would be `Content-Disposition: attachment; filename=example.dot` – War10ck Mar 29 '16 at 17:41
  • So this is something I need to configure on the server (apache), is there no client side configuration to say what to do with specific file extensions? – Jibby Mar 29 '16 at 17:46
  • Not that I'm aware of. A lot of behavior is based on these headers and how the browser infers them. Without the proper headers, the browser handles the request as best as it can which may or may not be correct after the browser makes assumptions. – War10ck Mar 29 '16 at 17:53
  • 1
    Why do you put your answer in a comment? – Jibby Mar 29 '16 at 19:58
  • And why spend time answering a question that's not useful enough to upvote? :) – Jibby Mar 29 '16 at 19:58

1 Answers1

4

For HTML5:

<a href='file.dot' download>Click here to download</a>

'Download' attribute documentation can be read at: http://www.w3schools.com/tags/att_a_download.asp

Supported since chrome 14.0.

EDIT: However this is controlled by the site. As for client-side settings, i think only changing the .DOT extension to match Word files in Windows, and perhaps even that won't work if chrome uses its own list.

In any case, you can right-click and "Save file as...", but yes, it's annoying.

henry700
  • 179
  • 3
  • 8
  • 1
    The download attribute would probably have a broader application, but your EDIT contained the easy answer in this case. I got a copy of the .dot (Word 97-2003 Template) file off of the server, saved it as a .dotx file (Word Template), put it back on the server, and adjusted the hyperlink accordingly. I guess chrome recognizes the new template format extension(.dotx), but not the old one (.dot)... – Jibby Mar 29 '16 at 19:50