我有curl文件上传的问题.我想在视频托管网站上传我的服务器文件.脚本需要Content-type: multipart/form-data和Content-type: video/mp4,但我不知道如何做到这一点.上传文件后有content type application/octet-stream.
这是脚本
class curl
{
function __construct($use = 1)
{
$this->ch = curl_init();
if($use = 1)
{
curl_setopt ($this->ch, CURLOPT_POST, 1);
curl_setopt ($this->ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($this->ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($this->ch, CURLOPT_RETURNTRANSFER, 1);
}
else
{
return 'There is the possibility, that this script wont work';
}
}
function first_connect($loginform,$logindata)
{
curl_setopt($this->ch, CURLOPT_URL, $loginform);
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $logindata);
}
function store()
{
$this->content = curl_exec ($this->ch);
}
function execute($page)
{
curl_setopt($this->ch, …Run Code Online (Sandbox Code Playgroud)