当我尝试发送大 PDF 文件(42 mb)时,我遇到了问题。获取文件有 API 限制吗?我的代码:
$filename_pdf = $_SERVER['DOCUMENT_ROOT'] . '/test/test_pdf_2.pdf';
$fh_res = fopen($filename_pdf, 'r');
$login = '******';
$password = '*********';
$url = 'http://do.convertapi.com/Pdf2Image';
// Create a CURLFile object
$cfile = new CURLFile($filename_pdf, 'application/pdf', 'test_pdf_2.pdf');
$data = array(
'File' => $cfile,
'OutputFormat' => 'jpg',
'ApiKey' => '******',
'StoreFile' => 1,
'Timeout'=>'1200'
);
$process = curl_init($url);
curl_setopt($process, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data'));
curl_setopt($process, CURLOPT_INFILESIZE, filesize($filename_pdf));
curl_setopt($process, CURLOPT_INFILE, $fh_res);
curl_setopt($process, CURLOPT_HEADER, 1);
curl_setopt($process, CURLOPT_USERPWD, $login . ":" . $password);
curl_setopt($process, CURLOPT_TIMEOUT, 600);
curl_setopt($process, CURLOPT_POST, 1);
curl_setopt($process, CURLOPT_POSTFIELDS, $data);
curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);
$return = curl_exec($process);
curl_close($process);
我的代码处理小文件。获取文件有 API 限制吗?