// 实例化
                        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)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-08-08
  • 2021-07-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-16
  • 2021-12-08
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案