如果截代码分享,请截出可以调试的整个部分!
来源:互联网 发布:财务管理数据库设计 编辑:程序博客网 时间:2024/06/08 02:47
鄙视网上某些Code大佬
I'm using the Bootstrap File Input plugin and I'm trying to get the images to the Controller but I'm not having any success. Has anyone implemented this in MVC that could give me some direction? I was successful in passing the contactId in the uploadExtraData
property. If I comment that out and use the data
property I receive an error message that a parameterless constructor for the method could not be found. That makes sense but I'm not sure how to pass the input array to the controller.
View Code
<div class="col-md-12 form-group"> <div class="editor-field"> <input id="input-702" name="kartik-input-702[]" type="file" multiple="true" class="file-loading"> </div></div><script type="text/javascript"> $(document).ready(function() { $("#input-702").fileinput({ type: 'POST', cache: false, allowedFileExtensions: ['jpg', 'png', 'gif'], allowedFileTypes: ['image'], maxFileSize: 2000, uploadUrl: '@Url.Action("ImageUpload", "Contact")', maxFileCount: 2, enctype: 'multipart/form-data', overwriteInitial: true, uploadExtraData: { 'request': document.getElementById('input-702').value, 'contactId' : document.getElementById('ContactID').value }, msgSizeTooLarge: "File {name} ({size} KB) exceeds maximum upload size of {maxSize} KB. Please Try again", msgFilesTooMany: "Number of Files selected for upload ({n}) exceeds maximum allowed limit of {m}", msgInvalidFileType: 'Invalid type for file "{name}". Only {types} files are supported.', msgInvalidFileExtension: 'Invalid extension for file {name}. Only "{extensions} files are supported.', }); });</script>
[HttpPost]public ActionResult ImageUpload(HttpRequest request, int contactId){ int contactID = (int)contactId; return null;}
0 0
- 如果截代码分享,请截出可以调试的整个部分!
- 分享--可以使html中网页整个居中,两边留白的代码
- 分享--可以使html中网页整个居中,两边留白的代码
- 整个的其余部分。
- 我的第三方登陆代码和分享代码部分
- VS2008修改部分代码总重新编译整个工程或解决方案的问题解决
- iOS 如何把view转成image,截屏分享/ 整个视图的分享。
- iOS 如何把view转成image,截屏分享/ 整个视图的分享。
- 给大家分享下隐藏整个界面软键盘的方法,如果大家有更好的方法也建议下,谢谢了
- 改变整个文本部分文字的颜色
- 如果把我剥得一文不名丢在沙漠的中央,只要一行驼队经过———我就可以重建整个商业帝国
- 部分GNU代码片 16、GDB调试多线程的方法
- 部分GNU代码片 17、GDB调试so的方法
- js部分知识整理,google浏览器的代码调试
- 一段可以让整个网站变黑白代码
- 一段可以让整个网站变黑白代码
- 一段可以让整个网站变黑白代码
- 如果可以
- Android ANR 分析解决方法
- pku2253 记录从初始到终点最小的路径(某一部分),迪杰斯特拉求最短路
- 通过java.net.URLConnection发送HTTP请求的方法
- redis 类
- Tomcat文件上传路径问题
- 如果截代码分享,请截出可以调试的整个部分!
- 主控-从属模式
- NSUserDefaults 简介,使用 NSUserDefaults 存储自定义对象
- selector和shape静态资源的使用
- STL系列十一 随机三趣题——随机重排,文件中随机取一行,生成N个随机数
- HDU 2232 机器人的舞蹈 矩阵乘法
- 讲义6:简单查询
- Eclipse的Android xml预览布局时,超出屏幕怎么看效果
- codeforces B - More Cowbell (贪心)