如何在ajaxFileUpload中添加更多参数....这是我的ajaxfileupload代码

时间:2013-09-08 08:36:12

标签: php jquery ajax

jQuery.ajaxFileUpload({
            url: '<?php echo base_url(); ?>profile_pic/prof_photo_upload',
            secureuri: true,
            fileElementId: 'photoimg',
            dataType: 'html',
            success: function(resp){
                $('.right-register-container-left-rows-fields').html(resp);
            }
        });

1 个答案:

答案 0 :(得分:0)

您正在将对象传递给ajaxFileUpload,要添加更多参数,只需向对象添加新属性,例如:

jQuery.ajaxFileUpload({
    url: '<?php echo base_url(); ?>profile_pic/prof_photo_upload',
    type: "POST",
    secureuri: true,
    fileElementId: 'photoimg',
    dataType: 'html',
    data: {
        somedata: "XXX",
        moredata: "YYY"
    },
    success: function(resp) {
        $('.right-register-container-left-rows-fields').html(resp);
    }
});