News for hackers. Stuff that matters.

matusgallik008

Re:Ask HN: How to handle user file uploads? on Friday May 03, 2024 @07:46AM (#40246553)
You're good mate. I meant exaclty what aprilnya said. I thought you are using the Lambda just to validate the 10mb limit - and just for that you don't need the lambda :) and could save yourself some cents & effort.

But if you do resizing as well, then ofc you need the Lambda (or some other compute engine).

Re:Ask HN: How to handle user file uploads? on Thursday May 02, 2024 @03:39AM (#40233682)
Well, security for starts. Having user A upload a malicious_file.png and then user B download it would not be ideal. Secondly, UX - having thumbnails for files can increase the loading speed. Arguably not the most important UX feature, but we have the resources to spend on this, so why not.
Re:Ask HN: How to handle user file uploads? on Thursday May 02, 2024 @03:37AM (#40233674)
I believe AWS S3 allows setting the Content-Length header as well. So you might not need the lambda
Re:Ask HN: How to handle user file uploads? on Thursday May 02, 2024 @03:34AM (#40233652)
Thanks for the insights! I had a look at ClamAV - never heard/worked with it. This was something I was looking for.

Do you also handle large files e.g. videos with lambda? Don't you struggle with Lambda limits then?

Ask HN: How to handle user file uploads?

hey, i work as an SRE for a company where we allow users to upload media files (e.g. profile picture, attach docs or videos to tasks..the usual). We currently just take a S3 pre-signed URL and let the user upload stuff. Occasionally, limits are set on the <input/> element for file types.I don't feel this is safe enough. I also feel we could do better by optimizing images on the BE, or...

( Read More... | 186 comments | 3 points | on HN )