How to open the file using FileDialog and display the path into textbox in asp.net mvc?
How to open the file using FileDialog and display the path开发者_运维问答 into textbox in asp.net mvc?
use <input type="file" name="imageFile" />
on the controller for your POST method include this HttpPostedFileBase imageFile
if (imageFile != null && imageFile.ContentLength > 0)
{
var fileName = Path.GetFileName(imageFile.FileName);
var fileExtension = Path.GetExtension(imageFile.FileName);
}
精彩评论