如何使用FileDialog打开文件并在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);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.