Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用js与php自动上传PDF文件_Javascript_Php_Jquery - Fatal编程技术网

Javascript 使用js与php自动上传PDF文件

Javascript 使用js与php自动上传PDF文件,javascript,php,jquery,Javascript,Php,Jquery,我有这样的php代码 //this have loop for repeat data by $i <tr> <th>Num:</th> <th>upload</th> </tr> <tr> <td><?php echo $i?></td> <td> <div id="me<?php echo $i ?>" num="<

我有这样的php代码

//this have loop for repeat data by $i
<tr>
  <th>Num:</th>
  <th>upload</th>
</tr>
<tr>
  <td><?php echo $i?></td>
  <td>
    <div id="me<?php echo $i ?>" num="<?php echo $i ?>" class="styleall me" ><span ><span class="glyphicon glyphicon-folder-open uploadChange"></span></span></div><span id="mestatus<?php echo $i ?>" class="mestatus" ></span>
    <div id="files<?php echo $i ?>" class="files">
        <li class="success">
        </li>
    </div>
  </td>
</tr> // end loop
//此循环用于按$i重复数据
号码:
上传
$('.uploadChange').click(function(event) {
    event.preventDefault();
    var num = $('.me').attr('num');
    var btnUpload = $('#me'+num);
    var mestatus = $('#mestatus' + num);
    var files = $('.files');
    new AjaxUpload(btnUpload, {
        action: '/uploadDoc.php',
        name: 'uploadfile',
        onSubmit: function(file, ext) {
            if (!(ext && /^(pdf)$/.test(ext))) {
                mestatus.text('PDF files are allowed');
                return false;
            }
            mestatus.html('<img src="/ajax-loader.gif" height="16" width="16">');
        },

        onComplete: function(file, response) {
            mestatus.text('File Uploaded Sucessfully!');
            files.html('');
        }
    });
});
new AjaxUpload(btnUpload, {
        action: '/uploadDoc.php',
        name: 'uploadfile',
        onSubmit: function(file, ext) {
            if (!(ext && /^(pdf)$/.test(ext))) {
                mestatus.text('PDF files are allowed');
                return false;
            }
            mestatus.html('<img src="/ajax-loader.gif" height="16" width="16">');
        },

        onComplete: function(file, response) {
            mestatus.text('File Uploaded Sucessfully!');
            files.html('');
        }
 });