Forum Moderators: open

Message Too Old, No Replies

Hyperlinks to MS Word docs not working

Links open File Explorer.

         

BeeDeeDubbleU

6:56 pm on Mar 11, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am on a website I built many years ago. It has links to several MS Word documents. Never had a problem before but now when I click these links File Explorer opens on my PC as though I am saving a file.

The links are in the format http://www. websitename. org. uk/docs/MSWordDocName.doc.

If I access the website on my cell phone and click the links nothing happens.

Any idea why this is happening?


[edited by: not2easy at 7:20 pm (utc) on Mar 11, 2021]
[edit reason] de-linked for readability [/edit]

lucy24

8:02 pm on Mar 11, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Any idea why this is happening?
This isn't a problem with your website; it's a decision made by your browser. You may or may not be able to change it in the browser prefs. In the case of a cell phone’s browser, the device probably won’t let you download files from anything but an authorized source, and it has nothing else to do with them, leaving you with “nothing happens”.

lammert

8:30 pm on Mar 11, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are the links http:// or https:// Newer versions of browsers block downloads from http:// links on https:// sites, but often still allow the https:// version downloads. In Chrome, this behavior started with version 82.

See also the topic Chrome 82 to Start Warning and Blocking "Mixed Content Downloads" [webmasterworld.com] which contains a table with the behavior of different browser versions and document types.

BeeDeeDubbleU

9:14 pm on Mar 11, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Looks like it's Chrome that causing the problem. It's allowing it to open hyperlinks to HTML pages and to PDFs but not to .doc files.

This is a PITA. Any idea how I get round it?

lammert

10:37 pm on Mar 11, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can try to add a Content-Disposition HTTP header when serving the file. The following header causes PDF files to open directly in the browser instead of first downloading them, but I am not sure how this will work with .doc files. You could experiment with this header to see if it fits your needs
Content-Disposition: inline

phranque

2:34 am on Mar 12, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



along the lines of lammert's suggestion, i would carefully examine all the response headers sent with that document, especially the Content-Disposition and Content-Type headers, and see if anything should be added or deleted that would be helpful for the problematic user agents.
i would also examine for clues the request headers sent from problematic user agents, especially the Accept header.

phranque

2:39 am on Mar 12, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Looks like it's Chrome that causing the problem. It's allowing it to open hyperlinks to HTML pages and to PDFs but not to .doc files.

This is a PITA. Any idea how I get round it?

have you verified that this is not an HTTPS site with links to non-HTTPS .doc downloads situation?
(i.e., the "Mixed Content Downloads" issue lammert mentioned above)