我不知道怎么描述我这个问题。。1.有一个A网站有一个上传文件的功能,查看源文件代码如下:
<form action="http://211.141.88.15/vpmn/public/index.php?controller=book&action=importexcel" method="POST" enctype="multipart/form-data" target="_blank">
<input name="excelfile" type="file" id="floatNum" reg="\S">
<input type="hidden" name="groupid" value="1318769">
<input type="submit" name="search" class="handin_bt" value="提交">
</form>
我每次要在对方这个网站上传文件,上面是条件,我想我做一个php页面,通过我这个php后台,把我网站服务器上的文件直接后台POST方式上传过去,而不用我人工一个个添加。。假如我做了一个:http://www.abc.com/sendpost.php页面。我要上传的文件在网站:www.abc.com 下面。我就是想通过sendpost.php直接把文件提交到问题1上的地址:http://211.141.88.15/vpmn/public/index.php 这里上传的时候一个是文件excelfile,一个是参数groupid1、能实现这样的功能
2、要怎么实现,有没有例子PHP POST 上传PHPPOST 上传
<form action="http://211.141.88.15/vpmn/public/index.php?controller=book&action=importexcel" method="POST" enctype="multipart/form-data" target="_blank">
<input name="excelfile" type="file" id="floatNum" reg="\S">
<input type="hidden" name="groupid" value="1318769">
<input type="submit" name="search" class="handin_bt" value="提交">
</form>
我每次要在对方这个网站上传文件,上面是条件,我想我做一个php页面,通过我这个php后台,把我网站服务器上的文件直接后台POST方式上传过去,而不用我人工一个个添加。。假如我做了一个:http://www.abc.com/sendpost.php页面。我要上传的文件在网站:www.abc.com 下面。我就是想通过sendpost.php直接把文件提交到问题1上的地址:http://211.141.88.15/vpmn/public/index.php 这里上传的时候一个是文件excelfile,一个是参数groupid1、能实现这样的功能
2、要怎么实现,有没有例子PHP POST 上传PHPPOST 上传
http://stackoverflow.com/questions/3892617/curl-php-file-upload
$data = array(
'excelfile' => '@' . '待上传的文件名',
'groupid' => '1318769',
'search' => '提交',
);$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);