'file' => '@'.realpath($path_dest).';type= multipart/form-data',这是单文件上传了,$path_dest是文件地址,
如果是多个文件地址呢,怎么弄呢
如果是多个文件地址呢,怎么弄呢
解决方案 »
- PHP通过openssl创建密钥
- 怎么把数组从android客户端传递到php服务器
- 如何设计可以接受频繁的数据库访问?
- php能不能一次建立多重子目录?
- 正则表达式错误:Compilation failed: unrecognized character after (?<
- PHP截取字符串问题
- 自从学.net就发觉自己整天在学新技术,新名词了,很少有时间把精力集中到具体业务编程上。
- 请各位大侠帮忙!(数据检索问题)
- 下拉菜单的问题 急!!!!!!!
- localhost/phpmyadmin 打开时候是php源码怎么解决
- SAE怎样调用数据库以实现微信公众平台数据库关键词回复?
- 在HTML的表格中显示数据库的数据信息
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.
/* 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数组里