We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Store generated document in another folder on Amazon s3

Hi,

I am using Saleforce REST API and Amazon s3 as storage. My bucket name is XYZ and I am keeping my .docx templates in QaTest folder of XYZ bucket. Then I am using ExecuteTemplate REST API to created docx file from template and it is generated in same folder But want to store generated document in ABC folder. Folder structure is as follows,

—All Buckets
— XYZ
---- QATest (Templates are stored in this folder)
— ABC (I wants to store generated document in this folder)

Can you guide me how to store generated document in ABC folder which is at same node level of QATest ??


Hi Sonal,

You can use filename parameter to specify the name and location of the output file as you can see in the following URI.

http://api.aspose.com/v1.1/words/ExecuteTemplate.docx/executeTemplate?storage=MyStorage&folder=Folder1&filename=./../Folder2/TestMailMergeResult.docx

Here Folder1 is the location where input document is present and Folder2 is the location where output file will be saved.

Best Regards,

Hi,

Thanks for your reply.

As you mentioned i created by URL as follows,
https://api.aspose.com/v1.1/words/DateChk.docx/executeTemplate?storage=XYZ &folder=Qatest&filename=./…/ABC/TEST_File%202016-02-24%2012:23:06.pdf&cleanup=EmptyParagraphs,UnusedRegions,UnusedFields,ContainingFields&appSID=XXXXXXXXXXX&signature=LdsZV022uhwkqJ5ocE8atJHfnA0

which is giving me an error as, AmazonS3 exception: The request signature we calculated does not match the signature you provided. Check your key and signing method

If I removed the ./…/ from filename is working fine and creates ABC folder inside the Qatest folder. But I wants it to store in ABC folder which is outside of Qatest folder.

Hi Sonal,

It is working with other storages. We are investigating it for S3 and will share the update soon.

Best Regards,

Hi Sonal,

You can use the following URI with POST method to move the output file to a new location.

https://api.aspose.com/v1.1/storage/file/S3BucketName/Folder2/TestOutput.pdf?storage=MyS3Storage&destStorage=MyS3Storage&dest=S3BucketName/Folder1/TestOutput.pdf

Best Regards,

Does this mean we always have to store the generated document in the template folder structure? Then we have to move it to the S3 bucket folder. Does this not double our megabytes for storage use and make us use more api references against out plan?

We should be able to save the merged file directly into S3 as it is one of your supported store services.

Hi John,


Thank you for the inquiry. It means you can store the output file in the same template folder or any sub folder. The template folder is already in the S3 storage. To move the file to upper folder than the template folder, you can use another API call. It is just like to move a file from one folder to another folder. It’ll not consume extra megabytes of storage. Please let us know in case of any confusion or questions.