Skip to content

Microservice which allow to upload to s3 files with smaller chunks

License

Notifications You must be signed in to change notification settings

knopa/s3-proxy-chunk-upload

Repository files navigation

S3ProxyChunkUpload

A microservice that lets you upload S3 files in smaller chunks

Description

When your mobile application stores files on Amazon S3, you can run into problems with repeatedly trying to upload files when your users have poor or unstable network connections.
Amazon S3 supports chunked uploading, but each chunk must be 5 MB or more.
In most cases, files sent via mobile apps are smaller than 5 MB, and so a different approach is needed.
To solve the problem of repeated attempts to upload a file to S3 storage, we have developed S3ProxyChunkUpload, a proxy server that sits between your application and Amazon S3.

Features!

  • Upload files of any size in any number of chunks to Amazon S3 storage
  • Compress uploaded files
  • Convert files to different formats

The S3ProxyChunkUpload app allows you to upload a file in any number of chunks – and those chunks can be of any size. By uploading in chunks, part of a file may be successfully uploaded even if a user has a slow internet connection or the connection drops, and other parts of the file can be sent when the connection is restored.

After each chunk of a file is successfully uploaded to the proxy server, a response is sent by the proxy server to your app to keep tabs on the status of the upload. After all chunks of a file are uploaded, they are combined on the proxy server to create a source file that is then sent to Amazon S3.

Installation


S3ProxyChunkUpload requires PlayFramework v2.5.0+.

Install the dependencies and start the server:

$ cd s3-proxy-chunk-upload
$ activator run

Tech


S3ProxyChunkUpload relies on a number of open source projects:

And of course, S3ProxyChunkUpload is open source itself, with a public repository on GitHub.

Configurations (application.conf)


  • db.default.driver = org.postgresql.Driver
  • db.default.url = "postgres://postgres:chunkupload@localhost/s3proxychunkupload"
  • DB_TYPE = "postgres"
  • AWS_ACCESS_KEY (access key for AWS)
  • AWS_SECRET_KEY (secret key for AWS)
  • AWS_S3_BUCKET = "com.s3proxy.posts" - bucket name
  • AWS_S3_HOST = "s3.amazonaws.com" (hostname)
  • UPLOAD_FOLDER = "/s3proxychunkupload/upload" (directory where temporary files will be located)
Notifications
Video conversion
  • AWS_ET_END_POINT = "elastictranscoder.us.amazonaws.com"
  • VIDEO_PIPELINE_ID = "0000000000000-xxxxxx"
  • VIDEO_PRESETS = {"stream" = "0000000000000-xxxxxx"} (to disable the conversion functionality, do not use this option)

License

S3ProxyChunkUpload is open source software licensed under the terms of the MIT license.

About

Microservice which allow to upload to s3 files with smaller chunks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published