zoukankan      html  css  js  c++  java
  • MVC 使用 Webuploader 插件 传递额外参数 备忘笔记

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

  • 相关阅读:
    加关注
    UI设计
    敏捷开发
    java书箱
    怎么优化JAVA程序的执行效率和性能?
    sql访注入
    Matlab中plot函数全功能解析
    matlab分割背景与物体
    ssh免密码登录
    c++字符串详解(转)
  • 原文地址:https://www.cnblogs.com/linqing/p/5978728.html
Copyright © 2011-2022 走看看