I want to upload a file to AWS s3
. I use nodejs as a server.
I wanted to know which approach is better. Uploading it from client side or Server Side?
As the file size is large I am worried about the bandwidth to send to server side and process it.
At the same time I am worried about the security issues of the key to process it from client side.
What are the pros and cons of upload a file from client side as well as server side?
Client -> Your Server -> S3 Upload Considerations:
Client Side Upload Directly to S3 Considerations:
Security - You have many options to provide access rights to the users to upload to S3: a) Signed URLs b) Access Keys (horrible idea) c) Cognito to provide temporary Access Keys. Recommendation: use Signed URLs generated on your server and no access keys of any kind handed to the client.
Cost - Inbound from the client to S3 is free.
Performance - Your server is not the man in the middle in regards to performance. Performance will be limited to the performance of the user's Internet connection. Customers will be less likely (but not always) to blame you for poor upload problems.
Reliability - There are lots of well tested libraries available for uploading to S3. Recommendation: invest in a production quality client (web browser) library that handles Internet interruptions and other issues, retries, nice user prompts, background uploads, etc.
Complexity - You will still need to write code (or purchase) for both the server and the client side. However, by choosing good quality software you can reduce your headaches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With