How to upload PPTX stream to S3 bucket (Java)

Hello Aspose Team!!!

Using Aspose.slide java lib, I’m developing an web app, in that a user can select multiple pptx file to build a new pptx file. So in my back-end code i’m merging all slides of pptx file into new presentation object and build it. I had deployed my this project into AWS-ec2 instance and it was working well. Now I’m moving from EC2 to AWS-lambda function and there is some limitation of lambda function i.e , (3GB RAM and 512MB ROM).

We know that presentation.save(param1, param2) method build a new pptx file. where
param1 = local_dir_path / Outputstream obj.

Suppose if user selected all pptx files are large size, then the size of new presentation will be large. In that case I can not refer local_dir_path due to 512MB ROM.

And if I’m moving to Outputstream obj, then in that case either I can get an ERROR like: JVM heap space or I can give a limited size to build pptx file.

My requirement is that: user can build ~2GB size of pptx file. So in both situation I’m unable to manage my requirement. Now i have an idea to fulfill my requirement. Here is my user story:

  1. I will have all pptx files, that user select to build new presentation into AWS s3 bucket.
  2. Using AWS-SDk, I will download each pptx file and will store into temp. pres. object and will attached each slide(Suppose there is only one slide into each temp. pres.) of temp. pres. into new pres.
  3. Now i will upload new Pres object into S3 bucket using streaming concept.
  4. Again point 2 will execute and then i will attached new slide into presenation obj that i have already uploaded into S3 bucket. this process will be continue until the loop will not be end.

Finally i just want to say that if i get a slide from temp. pres., then at that time i want to attached that slide into new pres. object that i have uploaded into S3 bucket. In this situation I will not store all slide info RAM and I can build ~2GB pptx file.

NOTE: This is my hypothetical concept, so if it is possible, then it woulld be great if i get any source code.

Thanks in Advance.

@gabhishek,

I have observed your requirements and like to share that from Aspose.Slides perspective, it allows you to save presentation on a disk or to OutputStream that you may use either to upload some where as well. From Aspose.Slides perspective, we may only provide assistance in terms of saving presentation to OutputStream and further saving of OutputStream to S3 bucket is actually beyond scope of API.