我应该对HttpPostedFileBase读取类型使用什么?

问题描述 投票:0回答:1

我有一个表单,用户可以提交一些详细信息和任何类型的文件,现在由于上传的文件的类型为HttpPostedFileBase,我该如何安排GetString的读取器,以便读取上载文件的文件名。谢谢

代码错误

enter image description here

属性

enter image description here

c# asp.net asp.net-mvc-4 model-view-controller httpfilecollection
1个回答
0
投票
为什么不通过以下方式检查文件扩展名:f.Substring(f.LastIndexOf('。')+ 1,3));
© www.soinside.com 2019 - 2024. All rights reserved.