I have a form where I take basic Resume information from user and then there is an upload button for Resume upload. Now I want to have a "Detail" page where I can show the details of user inputs for the Resume form. I am able to show all the Model properties except the (uploaded file). Is there some way I can show some sort of preview pane for document uploaded in the Detail page.
ViewModel:
public class ResumeViewModel
{
[Required(ErrorMessage = "Enter Resume Name.")]
[Display(Name = "Resume Name")]
public string ResumeName { get; set; }
[FileType("pdf|doc|docx|PDF", ErrorMessage = "File type is not valid.")]
[Required]
[Display(Name = "Upload Resume")]
public HttpPostedFileBase UploadedResume { get; set; }
}
Currently, I am able to download the document with below code
public FileContentResult Download(int? resumeId)
{
var temp = _context.Resumes.Where(f => f.ResumeId == resumeId).SingleOrDefault();
var fileRes = new FileContentResult(temp.Content.ToArray(), temp.ContentType);
fileRes.FileDownloadName = temp.FileName;
return fileRes;
}
But how to display it in some page along with rest of the Model properties?