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
Post a Comment