zoukankan      html  css  js  c++  java
  • uploadify上传文件,并且传参数

    function uploadify() {
            $("#uploadify").uploadify({
                method:'post',
                uploader: '/Manage/Order/SubmitUploadify',
                swf: '/Content/scripts/plugins/uploadify/uploadify.swf',
                buttonText: "上传文件",
                height: 30,
                110,
                fileTypeExts: '*.jpg;*.doc;*.docx;*.pdf;*.png',
                fileSizeLimit: '10MB',
                multi: false,
                formData: "ContractCode":"20170222","UserId":"20125"
                },
                onUploadStart: function (file) {
                    some code...
                },
                onUploadSuccess: function (file, data, response) {
                    var obj = jQuery.parseJSON(data); 
                    if (obj.State) {
                        $("#ContractFile").val(obj.FilePath);
                    }
                },
                onUploadError: function (file) {
                    $("#" + file.id).prepend('<span class="error" title="失败"><i class="fa fa-exclamation-circle"></i></span>');
                }
            });
            $("#uploadify-button").prepend('<i style="opacity: 0.6;" class="fa fa-cloud-upload"></i>&nbsp;');
        }

     在onUploadStart中传递参数:

     onUploadStart : function(file) {

    $("#imgFile").uploadify("settings","formData",$("#type").val());
    }
  • 相关阅读:
    OTA JAR和JAD的mime不同
    document.getElementById('selCatalog').remove(i)突然无效???!
    判断WAP1.1和WAP2.0并解析为wml或xhtml
    IE和firefox下显示html内容
    unixrisk tip
    unixftp windows
    unixstdin/stdout/stderr
    峰鸟摄影
    linuxgrep commond
    unixtutorial(recommended)
  • 原文地址:https://www.cnblogs.com/2070393244com/p/11714473.html
Copyright © 2011-2022 走看看