我正在使用php CURL进程上传文件,文件名显示在另一端,但文件大小为0。在各种论坛上进行了搜索,但仍然找不到解决方案。
针对该请求的SSL认证验证已停止。 示例代码在这里:
curl_setopt_array($curl, array(
CURLOPT_URL => "http://localhost/5.0/test/testcall_new",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $boundary_var
. "\r\nContent-Disposition: form-data; name=\"CandidateJson\"\r\n"
. "\r\n" . $profile_data . "\n\r\n"
. $boundary_var
. "\r\nContent-Disposition: form-data;"
. " name=\"JobId\"\r\n\r\n" . $jobId . "\r\n"
. $boundary_var
. "\r\nContent-Disposition: form-data; name=\"ResumeFile\"; filename=@".realpath($file_name_with_full_path)."\r\nContent-Type: ".mime_content_type($file_path)."\r\n\r\n\r\n"
. $boundary_var,
CURLOPT_HTTPHEADER => array(
"accept: application/json",
"authtoken: XXXXXXXXXXXXXX",
"cache-control: no-cache",
"content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
"service-agent: MeraJob"
),
));
我在另一端遇到以下错误:
Array([ResumeFile] => Array([name] => 1657192_1_5b6ab0b1d200c.pdf [type] => application / pdf [tmp_name] => C:\ wamp \ tmp \ php7D58.tmp [error] => 0 [大小] => 0))
我被困在这里,请提出建议。