Image upload and hosting
How do you host images securely?
The images would only be uploaded by admins and displayed to users.
The upload should take place via the ASP.NET Core App, but where to? How do you do that?
The app is small and would have a few hundred users.
So far I have only published internally on the intranet.
This time the project should be accessible from the Internet 😨 and I don't know how to make the image upload possible and secure.
3 Replies
I usually use a binary bucket service like azure storage or s3. Regarding the security, there are a few considerations:
1. You can configure the asset to be entirely public or private. So, very coarse.
2. When you set the asset to private, you can usually generate a temporary "lease" for the asset, for azure storage that would be a "SAS token".
Oh, I just reread your post - It seems like you do not need fine grained access control, only for the upload part?
In that case you can have your API accept the resource, check the users role, and then only allow uploading when they are an admin. All the large bucket services come with a C# SDK
You might also get away with storing binaries in your database (sql / nosql should both be capable of doing this), but it's not really something I would suggest
If I use Azure Blob Hotstorage, is the retrieval completely free?
Then my estimates in the price calculator would be max. around €1 per month. It looks like I didn't understand the price calculator.
It's generally really cheap, you pay by the GB and not by bandwith