0

I have created a shortcut file by going to Desktop -> new shortcut and entered link.

Now I have uploaded this shortcut file (*.url) on the root on my server as shortcut.url

When i directly access mysite.com/shortcut.url, it does not start the download of it but instead show the content of the .url file.

Now on my page where i link to mysite.com/shortcut.url, I have tried the following methods:

How to start automatic download of a file in Internet Explorer?

But noone of them seems to work in Chrome (I though that if it their answers work in IE then Chrome it would too).

How is it possible to start downloading of this type of file, on click?

Community
  • 1
  • 1
Karem
  • 17,615
  • 72
  • 178
  • 278

1 Answers1

1

Generally speaking, a browser will fetch a resource in download mode (rather than displaying directly) if the content type is one that it cannot handle, and no plugins can handle. The easiest way for that to be the case is by using the content type for generic binary files:

Content-Type: application/octet-stream

Basically, configure your web server to use this content type (often called a MIME type) for .url files. How you do that depends on what server you're using.

Brad
  • 159,648
  • 54
  • 349
  • 530