Free Support Forum - aspose.cloud

Convert Word to PDF with Java SDK of Aspose.Words Cloud throws forbidden error

I am trying to convert a word document to a pdf using the cloud api. I have a storage mapped to amazon s3. My Java code is as follows:


String amazonS3StorageName = “MyStorageName”;

//build URI to convert MS Word file to other format using storage
String strURI = “http://api.aspose.cloud/v1.1/words/” + fileName + “?format=pdf&storage=” + amazonS3StorageName + “&folder=” + bucket + “/” + folderPath;
//sign URI
System.out.println(strURI);
String signedURI = Sign(strURI, appSID, appKey);
System.out.println(signedURI);
try
{
InputStream responseStream = ProcessCommand(signedURI, “GET”);
//boolean response = SaveStreamToFile(relativePath + “.pdf”, responseStream);
responseStream.close();
}
catch(Exception e)
{
}

The problem is, I am always getting “Forbidden”.

I don’t see what the problem with this is. I just modified an example I found on your website.

Hi Ash,

Can you please confirm if you have followed these steps https://docs.aspose.cloud/display/totalcloud/Configure+Amazon+S3+Storage to map your S3 storage with Aspose Cloud? If yes, can you please send following information to me at muhammad.ijaz@aspose.com?

  • Your App SID and App Key
  • Name of the mapped storage
  • Your S3 bucket name

Best Regards,