Trivial example following your org/user pattern:
my_app/profile_images/org_id/user_id/aabbccccccc.jpeg
I then obviously have a reference to that file in my db.
Trivial example following your org/user pattern:
my_app/profile_images/org_id/user_id/aabbccccccc.jpeg
I then obviously have a reference to that file in my db.
I didn't think of using different prefixes for different media usages. We for example would then use thumbnail/originating_file_uuid.png and poster/originating_file_uuid.png.
How would you handle uploaded media then?
Then in your app, you can have a way of specifying which version of the file you'd like to reference, for example:
`user.avatar.large -> '<path>/uuid_large.png'`
Not sure if that helps?
I could shorten the key by moving the sha512sum from the url to a CHECKSUM file.
org/file_uuid/original/original_filename.png CHECKSUM org/file_uuid/thumb/160x90.png 48x48.png org/file_uuid/poster/1k.png 2k.png org/file_uuid/other/
Personally I'm uploading directly from the browser to S3 using presigned URL's. All files get uploaded to a /tmp directory in my bucket. This bucket is configured so that all files in /tmp are deleted after 1 day (to remove any unsaved uploads). When a form is submitted, I pass the key to the temporary file in the form (via e.g <input type="hidden" name="s3_key">) and create the associated database record. I then move the file from its temporary location to its permanent one upon saving said record.
Feel free to email me to continue this discussion - email address is on my profile.
Sure, but that's a tradeoff nearly every website accepts because they just need the image itself. If you do want to preserve the original filename, is there a reason for not just keeping it in a database?