create link with file download

Asked

Viewed 636 times

1

People create a link on my site so that the user can download a file. The link works 100%, however after the user clicks to download the file and downloaded to download folder from the computer. How do I open the browser window by asking which place to save the download?

Example of the link I created.

<div onclick='document.location="Arquivos/arquivo.rm"'>Baixar</div>

The file has the extension . rm

  • As you right-click on the link and go to "save as", the only way you can open the dialog window to save to another folder is like this. Maybe you can make a javascript button that when you click it already opens the window save as. Just an idea!

1 answer

4

Hugo, for security reasons, you can’t do this manipulation.

To appear the option to show the window where the file must be saved, the user must mark this option in the browser settings.

For example, in Chrome v53.0.2785.143 this option is in Settings, as shown in the image below:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.