c# - How create a link to open local file? -


i'm trying create link files located in local folder doesn't open file. i'm using razor create links. code below:

<a href="@item.url\@item.filename" class="btn btn-info">@item.filename </a> 

and outputs...

<a class="btn btn-info" href="c:\users\dev\documents\sp\create.txt">create.txt </a> 

but doesn't open file reason

the file not open because web server (fortunately, security reasons) not have access dev user's documents folder.

use relative path under web application's root directory. app_data commonly used purpose, e.g.

<a href="@url.content("~/app_data/sp/create.txt")">create.txt</a> 

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -