c# - cannot use Directory.GetFiles to get the server path -


in view mode, use following code, works

for (int i=1; i<=3; i++) {     string imgpath = "/temp/2490/" + i.tostring() + ".jpg";      <img width="200" height="200" src="@url.content(imgpath)" /> } 

i want let user view documents , download it, use following code , folder routes c:/temp/2490, , chrome don't let me view local files, wrong following codes?

foreach (var file in directory.getfiles(@url.content("/temp/2490"), "*.jpg, *.pdf", searchoption.alldirectories)) {     <li>         <a href="@url.content(file)">document</a>     </li> } 

directory.getfiles takes path parameter. not url. here want pass @"c:\temp\2490.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -