// 实例化
uploader = WebUploader.create({
pick: {
id: '#filePicker-2',
label: '点击选择图片'
},
formData: {
key: $("#id").val() //将#id 元素的Val 作为额外参数传递给Action
},
dnd: '#dndArea',
paste: '#uploader',
swf: 'lib/webuploader/0.1.5/Uploader.swf',
chunked: false,
chunkSize: 512 * 1024,
server: '/Products/Product/Upload',
// runtimeOrder: 'flash',
// accept: {
// title: 'Images',
// extensions: 'gif,jpg,jpeg,bmp,png',
// mimeTypes: 'image/*'
// },
// 禁掉全局的拖拽功能。这样不会出现图片拖进页面的时候,把图片打开。
disableGlobalDnd: true,
fileNumLimit: 30,
fileSizeLimit: 200 * 1024 * 1024, // 200 M
fileSingleSizeLimit: 50 * 1024 * 1024 // 50 M
});
将#id 元素的Val 作为额外参数传递Action
Action 写法:
public ActionResult Upload(string id, string name, string type, string lastModifiedDate, HttpPostedFileBase file, string key)