0

I wrote a code like this:

<a href="input.txt" download="output.txt"><button>Download</button></a>

But, it only works in Chrome and Firefox. IE doesn't support it.

How to do this in a way that all browsers support it?

Aᴍɪʀ
  • 7,623
  • 3
  • 38
  • 52
NAGARAJU
  • 3
  • 3

1 Answers1

0
<form method="get" action="input.pdf">
    <button type="submit">Download</button>
</form>

You could use a button like this for the download. This wont work in files like txt and images. for forcing download for these files, changes need to made in the server side.

Aᴍɪʀ
  • 7,623
  • 3
  • 38
  • 52
Ajay Bhasy
  • 1,920
  • 1
  • 26
  • 38