CulturalMe / meteor-slingshot

Upload files directly to AWS S3, Google Cloud Storage and others in meteor
MIT License
594 stars 105 forks source link

name convention of filename #167

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi there,

could it be that the filenames are somehow wrong?

The name that is saved from slingshot is: https://myBucket.s3-eu-central-1.amazonaws.com/filename/

while the real filename in S3 is:

https://s3.eu-central-1.amazonaws.com/myBucket/filename/

How can that be solved?

Regards

ghost commented 8 years ago

I just found out that one can change the bucketURL as a function(bucketUrl: function (bucket, region)). It can be found in the default values in meteor-slingshot/services/aws-s3.js

Maybe your source code should be extended by something like:

        if (region === "eu-central-1") {
            bucketDomain = "s3.eu-central-1.amazonaws.com";
            return "https://" + bucketDomain + "/" + bucket;
        }

in the directiveDefault bucketUrl: function.

Also the leading "/" must be removed in order for it to function well.

Regards