0

We try to download msv file in js. Our code:

var link = document.createElement("a");
                                   link.download = 'SampleReport.msv';
                                   link.href = "C:/Mcf/16-02-2016.msv";
                                   link.click();

But it doesn't work.What do we do wrong? Thanks!

Nom
  • 103
  • 1
  • 10
  • `link.href = "C:/Mcf/16-02-2016.msv";` - Javascript in a browser cannot access something on a client's PC. Your href value needs to be something addressable on the web. – neilsimp1 Feb 16 '16 at 15:31
  • @ neilsimp1 thank u very match! U help as so match! – Nom Feb 16 '16 at 15:45
  • Possible duplicate of [How can I create a link to a local file on a locally-run web page?](http://stackoverflow.com/questions/18246053/how-can-i-create-a-link-to-a-local-file-on-a-locally-run-web-page) – Johannes Jander Feb 16 '16 at 15:55

0 Answers0