2011-08-09 73 views
0

我有一个带有几个文本字段和一个文件上传字段的表单。发布到PHP脚本,然后使用curl将文本/文件数据发布到外部网站

<form enctype="multipart/form-data" method="POST"> 
<input name="source" type="file"> 
<input name="message" type="text" value=""> 
</form> 

我需要将文本输入和文件输入发布到自身。然后取出发布的数据,并使用curl将其发布到Facebook的图表api中。

这可能吗?如果是这样,任何用于通过curl发送文件数据的代码示例将不胜感激。谢谢!

+1

我将结合[变量从外部源(http://php.net/manual/en/language.variables.external.php)的一般概念和[文件上传处理](http://php.net/manual/en/features.file-upload.php)给出的答案在[如何使用PHP,curl和HTTP POST通过流式传输文件上传文件?](http:/ /stackoverflow.com/questions/5260985/how-to-upload-a-file-with-php-curl-and-http-post-by-streaming-the-file)。 – hakre

回答

0

想通了。这里是解决方案:

相关问题