DOCX to PDF conversion issue with Aspose.Words Cloud API

I followed the examples and uploaded a file to test

I uploaded this file in the default storage

912_1396938970.docx

using following request to check if it exists

I just get 404

This message was posted using Email2Forum by Tahir Manzoor.

Thanks for your inquiry. I have tested the scenario using your App SID and Key and have not found the shared issue. I have attached the output Pdf file with this post for your kind reference. Please read following documentation links.

Convert Word Documents

Thanks for the quick response.

I managed to resolve that and conversion is working fine. Now the issue I ran into is related to storage.

When I use this code:

$strURI = "http://api.aspose.com/v1.1/storage/file/";
$signedURI = Sign($strURI, $appSID, $appKey);
echo(uploadFileBinary($signedURI, $fileName));

I get the following error

Invalid Amazon S3 file path 4702/1e6af3c1-0983-499b-9a1a-aa114e77124c/

Hi there,

Thanks for your inquiry. Please supply the file name in strURI with full path where you want to upload the file. Please read following documentation link for your kind reference.

@AryaXSG

Please note since Aspose.Words Cloud 19.4, we have introduced storage methods in Aspose.Words Cloud. So now you do not need to use Aspose.Storage Cloud for storage operations. Please find the sample code to upload files to the default storage. You can pass the storage name parameter as per your scenario.

    $remoteDataFolder = "Temp";
	$localFile = "C:/Temp/Sections.docx";
	$remoteFileName = "Sections.docx";
        
	$uploadRequest = new Aspose\Words\Model\Requests\UploadFileRequest($localFile,$remoteDataFolder."/".$remoteFileName,null);
	$wordsApi->uploadFile($uploadRequest);

Secondly, you can also convert documents from your local drive instead of using cloud storage.

try {

	//TODO: Get your ClientID and ClientSecret at https://dashboard.aspose.cloud (free registration is required).		
	$ClientSecret="xxxxxxxxxxxxxxxxxx";
	$ClientID="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx";


	$wordsApi = new Aspose\Words\WordsApi($ClientID,$ClientSecret);
	
	
	$format = "pdf";
	$file = ("C:/Temp/02_pages.docx");
    
	$request = new Aspose\Words\Model\Requests\ConvertDocumentRequest($file, $format,null);
	$result = $wordsApi->ConvertDocument($request);	
	copy($result->getPathName(),"02_pages.pdf");
	//print_r($result->getPathName());
        
} catch (Exception $e) {
	echo  "Something went wrong: ",  $e->getMessage(), "\n";
	PHP_EOL;
}