1

Is it possible to download a file directly to desktop from a given HTTP URL in Angular 4 project?

For example, I have this URL - http://XXXXXX/XXXX/content/XXX/2/5.xml.

And I have used it as below -

<a href="http://XXXXXX/XXXX/content/XXX/2/5.xml" target="_blank" class="btn btn-info btn-round btn-just-icon" data-toggle="tooltip" data-placement="bottom" title="Download">
        <i class="fa fa-download" aria-hidden="true"></i></a>

This opens the contents of the file in a new window. Instead I want it to be downloaded as 5.xml.

Any ideas?

Neeraj
  • 483
  • 9
  • 17

1 Answers1

0

This is a normal HTML attribute, add download to your a element

zmuci
  • 518
  • 1
  • 5
  • 21