Free Support Forum -

Download image / zip from remote cloud storage with Aspose.Words Cloud

My code for download image / zip is as follow.

             $ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, '');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
	curl_setopt($ch, CURLOPT_VERBOSE, true);  
	$headers = array();
	$headers[] = 'Accept: application/json';
	$headers[] = 'Authorization: Bearer <access_token>';
	$headers[] = 'Content-Length: 0';
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($ch);
	if (curl_errno($ch)) {
		echo 'Error:' . curl_error($ch);
		$info = curl_getinfo($ch);

Above code is returning 500 error.


Thanks for your inquiry. Please check the following sample cURL commands for uploading, splitting and downloading the file from Aspose default storage. Hopefully it will help you to accomplish the task. However, if the issue persists, then please share yoru sample source document here. We will look into it and will guide you accordingly.

// First get JSON Web Token
// Get App Key and App SID from
curl -v "" -X POST -d "grant_type=client_credentials&client_id=[MyAPP_SID]&client_secret=[MyAPP_KEY]" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json"

// cURL example to upload file to Aspose Default Cloud Storage
curl "" -X PUT -H "accept: application/json" -H "Content-Type: multipart/form-data" -T C:/Temp/TOC_Test.docx -H "authorization: Bearer [ACCESS_TOKEN]"

// Split Word Document from Aspose Default Cloud Storage and Save to ZIP file
curl -X PUT "" -H "accept: application/json" -H "authorization: Bearer [Access_Token]"

// Download ZIP file from Aspose Default Cloud Storage
curl -X GET "" -H "accept: application/json" -H "authorization: Bearer [Access_Token]" --output C:/Temp/