PLee
PLee

Reputation: 453

html hyperlink download file issue

I use absolute path <a href='N:\myName\test.xlsx'>download</a>to download file from file folder. However, when I click it, the file is open directly instead of downloading it.

If I use relative path <a href='js/template/test.xlsx'>download</a>, the file is downloaded before opening it.

My question is that how I can download the file instead of directly opening it using absolute path like

<a href='N:\myName\test.xlsx'>download</a>

Thanks, Peter

Upvotes: 0

Views: 1456

Answers (1)

Jack Bashford
Jack Bashford

Reputation: 44107

That absolute path is stored on your computer, which means it's a link to that file. You can't download something that's stored on your computer - it has to be stored on the web to download.

Upvotes: 1

Related Questions