I’m having some troubles on an app to manage files upload to a s3 bucket (images, videos, pdf…) and I don’t seem to find a general agreement on which package to use ?
Some packages like s3 slingshots seem to be completly abandonned. Are they still usable and safe ? can they manage signedUrl ?
Is there any viable alternative to upload from client with keeping a server side control of who and what can be sent ?
It is usable. The biggest issue with it is it doesn’t support multi part upload. It’s possible to implement this yourself, but it’s a massive pain. And the aws documentation isn’t great. We’ve also found that small network issues cause it to crash with random errors, the advantage of multi part uploads is you can retry a chunk of the file if it fails.
Regarding signed URL I believe this is what s3 uses by default. A request is sent to your server which validated the request and returns the upload url which is signed.
Hi, this minio client looks nice too. Any example of integration with Meteor in order to control the right for users to upload or not for example ? or limit file type?
You can control this on the method signing the url for authorization. If the user has no permission, do not sign the url, which means the user cannot upload to your s3 bucket
You can definitely upload from the client, but your AWS keys will be exposed to the public, if you’re fine with that, then go a head.
When you publish your project your code will be minified and your keys will be hard to spot.
I’m working on project designed for < 50 users therefore that was my approach.
Another way, Maybe what you want is to call method to the server to generate a pre-signed URL the is short lived and can be used by the client to upload directly.
Can’t afford to display aws key, especielly for file upload, and I would really advice you not doing so whatever the project size is.
Things can get very costly
Other solution are great as they use the aws key to get the signedUrl on server side, give it to client who can then upload. So I’ll go for one of the other proposed solution I guess. Thanks a lot though!
Your package could do the trick as well I guess, I think you mentioned it on stack overflow as well. It’s just a bit worrying always to use a package with so little “fame” to work on a quite big project, it always feel less safe even though it may be a mistake to think so. I’ll have a look at it too.
I’ll try implementing it in the next few days, though the documentation is quite lite (API is there but not much example) and I’m not sure what method to use where. I may need your help in the near future but I’ll explain my progress here and if it succeeds write a little “how to meteor / evaporateJs”. If you have a mini sample code of what method you use where (create to get the signedUrl on the serve after you use the config on server as well ? passing it back to client and then add to upload the file on client side using the signedurl ? ). It surely would ease the process
Sorry but I do not have a mini sample code. Our code is part of a more complex component handling all our uploads. But the process should be simple. When you load the component for file select, you also prepare the config for evaporatejs. During this time, you send the signing parameters to the server, server sign it, and you include the signed url to the parameters of the function