2017-06-29 196 views

回答

0

您可以使用下面的代码将文件上载到Docparser

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_USERPWD, "<SECRET_API_KEY>" . ":"); 
curl_setopt($ch, CURLOPT_URL, 'https://api.docparser.com/v1/document/upload/<PARSER_ID>'); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file'=> '@' . realpath($file_name_with_full_path))); 
$result=curl_exec($ch); 
curl_close($ch); 

您需要更换值<SECRET_API_KEY><PARSER_ID>$file_name_with_full_path