开发者

How to open the file using FileDialog and display the path into textbox in asp.net mvc?

开发者 https://www.devze.com 2023-02-14 22:58 出处:网络
How to open the file using FileDialog and display the path开发者_运维问答 into textbox in asp.net mvc?use<input type=\"file\" name=\"imageFile\" />

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);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消