简体   繁体   中英

open the file instead of the link and not to download

In my HTML I have created a link to a .pdf file outside and I wish that when I click on the word of my link would open automatically the file and not to ask me to download the file link. It can do this ????

The link I created and this:

<a href="file.pdf">Nome link</a>

There is no real way to force a user to open a file directly from the web using standard HTML.

This is something the browser chooses. Chrome always downloads, for instance. Firefox and IE may download, save to a temp folder, and then "open" the downloaded temp copy. But in those browsers the user always has a choice.

NOTE: You can actually go the other way - force a download instead of letting the browser open it - by using HTTP headers.

When the file is downloaded you can choose options and then select always open this kind of files.

Works in Edge and Chrome

When thé link the description is download toi Can choose options and then select Always open this if files.

Works un effet and chrome

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM