TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
asif tariq
NA
148
17.1k
Download file in asp.net mvc
Nov 29 2019 1:21 PM
I want to download a file or image but error show this.please help me. i am working on asp.net mvc
in controller for download a file
public FileResult DownloadFile(string fileName)
{
var filepath = System.IO.Path.Combine(Server.MapPath("~/Content/FileStorage/"), fileName);
return File(filepath, MimeMapping.GetMimeMapping(filepath), fileName);
}
in view for showing
@Html.ActionLink("Download", "DownloadFile", new { fileName = item.Path })
Error showing
Could not find a part of the path 'E:\Websites\MPOWERING\MPOWERING\MPOWERING\Content\FileStorage\~\Content\FileStorage\scene19313767.jpg'.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:
System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\Websites\MPOWERING\MPOWERING\MPOWERING\Content\FileStorage\~\Content\FileStorage\scene19313767.jpg'.
Reply
Answers (
2
)
Top product you are given a list of product sales.
Compare two list with multiple columns