ASP.NET MVC 中的文件上传没有输入字段类型文件?
我想在我的 MVC 站点上提供文件上传功能,并且输入字段 type="file" 没有问题。但问题是,浏览器决定该字段的外观,这会破坏页面的外观和感觉。
所以我的问题是,如果我想要下载和上传图标/图像等,而不是由输入 type="file" 字段创建的默认按钮,这可能吗?
I want to have file upload possibilites on my MVC site, and I have that no problem with the input field type="file". But the problem is, the browser decides how this field should look, and that ruins the look and feel of the page.
So my question is, if I want to have icons/images for download and upload and so on instead of the default button that is created by the input type="file" field, is that possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
银光是不可能的吗?
http://slfileupload.codeplex.com/
我建议这样做的原因是因为您的选择非常有限文件输入字段。出于明显的(我希望)安全原因,它不会被脚本化或以其他方式自动化,并且只能以非常基本的方式进行视觉定制。
-奥辛
Is silverlight out of the question?
http://slfileupload.codeplex.com/
The reason I suggest this is because your options are very limited with the file input field. For obvious (I'd hope) security reasons, it is immune to being scripted or otherwise automated and is only visually customizable in very basic ways.
-Oisin
有大量的 javascript + flash 组合上传器可以取代按钮并添加其他功能,例如进度条、文件类型和大小检查等。SWFUpload 和 jQuery Uploadify 是其中两个较流行的上传器,并且非常容易实现。
There are a ton of javascript + flash combination uploaders that can replace the button and add other goodies like progress bar, file type and size checking, etc. SWFUpload and jQuery Uploadify are two of the more popular ones and are pretty easy to implement.