新的AjaxUpload发送其他数据

时间:2019-07-11 11:00:50

标签: jquery ajax upload

我正在使用以下方法上传文件。我想发送其他用户信息。我该怎么办

jquery

<script type="text/javascript" >
$(function(){
    var btnUpload=$('#upload');
    var status=$('#status');
    new AjaxUpload(btnUpload, {
        action: 'upload-file.php',
        name: 'uploadfile',
        onSubmit: function(file, ext){
             if (! (ext && /^(xls|xlsx)$/.test(ext))){ 
                // extension is not allowed 
                status.html('Only xls, xlsx files are allowed');
                return false;
            }
            //status.text('Uploading...');
             jQuery("#plot").html("<img src='images/ajax-loader.gif'/>");
        },
        onComplete: function(file, response){
            //On completion clear the status
            jQuery("#plot").html("");
            status.text('');
            //Add uploaded file to list
            alert(response);

                jQuery("#plot").html(response);
                //.addClass('success')

        }
    });

});

html

 <div>
Kindly ensure that you are uploading .xlsx files (Office 2007) . It should have 8 columns, and data from second row onwards. First row can be used for give headings, if you wish to do so. Column order for data is date (in YYYY-MM-DD) , time (24 hr, hh:mm:ss format),  direction (in degree,) speed (m/s) There is no data validation employed. Hence please ensure that the uploaded file contains valid data.
</div>
Height<input name="height" type="radio" value="10" />10m<input name="height" type="radio" value="60" />60m<input name="height" type="radio" value="100" />100m
<div id="upload" ><span>Upload File<span></div><div id="plot"><span id="status" ></span></div>

        <ul id="files" ></ul>
</div>

如何将所选的单选按钮值与文件一起传递?

0 个答案:

没有答案