'file' => '@'.realpath($path_dest).';type= multipart/form-data',这是单文件上传了,$path_dest是文件地址,
如果是多个文件地址呢,怎么弄呢

解决方案 »

  1.   

    <form action="file-upload.php" method="post" enctype="multipart/form-data">
      Send these files:<br />
      <input name="userfile[]" type="file" /><br />
      <input name="userfile[]" type="file" /><br />
      <input type="submit" value="Send files" />
    </form>
    When the above form is submitted, the arrays $_FILES['userfile'], $_FILES['userfile']['name'], and $_FILES['userfile']['size'] will be initialized.
    For instance, assume that the filenames /home/test/review.html and /home/test/xwp.out are submitted. In this case, $_FILES['userfile']['name'][0] would contain the value review.html, and $_FILES['userfile']['name'][1] would contain the value xwp.out. Similarly, $_FILES['userfile']['size'][0] would contain review.html's file size, and so forth. 
    $_FILES['userfile']['name'][0], $_FILES['userfile']['tmp_name'][0], $_FILES['userfile']['size'][0], and $_FILES['userfile']['type'][0] are also set. 
      

  2.   

    <?php
    /* http://example.com/upload.php:
    <?php var_dump($_FILES); ?>
    */// Create a cURL handle
    $ch = curl_init('http://example.com/upload.php');// Create a CURLFile object
    $cfile = new CURLFile('cats.jpg','image/jpeg','test_name');// Assign POST data
    $data = array('test_file' => $cfile);
    curl_setopt($ch, CURLOPT_POST,1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);// Execute the handle
    curl_exec($ch);
    ?> 
    参考上例:
    用new CURLFile()创建多个要上传的文件,放到$data数组里
      

  3.   

    http://blog.csdn.net/qq_29518403/article/details/52817879 可以看看这个,有疑问联系我