processone / ejabberd-contrib

Growing and curated ejabberd contributions repository - PR or ask to join !
http://ejabberd.im
248 stars 137 forks source link

mod_s3_upload: better object name generation #329

Closed Guerteltier closed 5 months ago

prefiks commented 5 months ago

Hello,

Did you test that and seen that this works correctly? This switches from .../... to .../.../... and i am not sure if s3 do support that extra path depth?

Guerteltier commented 5 months ago

S3 doesn't really have a concept of folders.

Amazon S3 supports buckets and objects, and there is no hierarchy. However, by using prefixes and delimiters in an object key name, the Amazon S3 console and the AWS SDKs can infer hierarchy and introduce the concept of folders. https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html

I tested the changes with Backblaze B2, but they should work with S3 as well.

Guerteltier commented 5 months ago

The main improvement in my opinion is that now it doesn't cause a prefix to be added to the names of uploaded files.