How is your experience with the OutSystems Community?
16
Views
1
Comments
Best Practice for Uploading Large Files to Amazon S3 Through a Proxy in ODC
Question

Hi everyone,

We are implementing a file upload feature in OutSystems Developer Cloud (ODC), where files need to be uploaded to Amazon S3 through a proxy.

However, we have encountered some limitations with our current approach:

  • ODC's Consume REST API does not support sending files through our required proxy setup, so we have to use External Logic to handle the proxy communication.
  • External Logic has a 5 MB request size limitation, which prevents us from sending large files in a single request.

To work around these limitations, we currently use the following approach:

  1. Split the original file into smaller chunks on the frontend.
  2. Send each chunk to External Logic individually.
  3. Upload each chunk to a temporary location in Amazon S3.
  4. After all chunks have been uploaded, call another Server Action to retrieve all chunks from S3.
  5. Merge the chunks in External Logic to reconstruct the original file.
  6. Upload the merged file to the final S3 location.

Although this approach works as a workaround, it introduces additional network traffic, temporary storage requirements, file processing overhead, and complexity in handling failed uploads and cleaning up temporary files.

Questions:

  1. Is there a recommended best practice for uploading large files to Amazon S3 through a proxy in ODC?
  2. Is there a way to stream file content through External Logic without loading the entire file into memory or being restricted by the 5 MB request size limitation?
  3. Would using S3 Multipart Upload be a recommended approach in this scenario? If so, how should it be implemented in ODC while maintaining the proxy requirement?
  4. Is there a supported mechanism or alternative architecture that would allow us to avoid storing chunks temporarily and then retrieving and merging them in External Logic?

We would appreciate any recommendations regarding the supported architecture and best practices for handling large file uploads in ODC.

Thank you!

2019-01-07 16-04-16
Siya
 
MVP

@Anh Tuan Duong : I would suggest upload the file directly from your browser to S3 instead of bringing to ODC first and uploading from there.  You can find an implementation  @ https://www.outsystems.com/forge/component-overview/14747/aws-s3-direct-file-upload-sample-o11 by @Stefan Weber 

You can find the technical details @ https://docs.aws.amazon.com/AmazonS3/latest/developerguide/sigv4-UsingHTTPPOST.html


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.