Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some AWS S3 problem #31

Open
GinoToo opened this issue Dec 29, 2014 · 4 comments
Open

some AWS S3 problem #31

GinoToo opened this issue Dec 29, 2014 · 4 comments

Comments

@GinoToo
Copy link

GinoToo commented Dec 29, 2014

Hi
i am using this for my uploader, all will go the AWS S3
when i try it i have some problem

  1. when read the file form AWS the URL is not work the error is
    The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

then i change the code in the index.js line 250 to
url: (options.useSSL ? 'https:' : 'http:') + '//' + options.storage.aws.bucketName + '.s3-' + options.storage.aws.region + '.amazonaws.com/' + o.Key

them is can display correct, is that ok ?

  1. when post to aws that is no any thumbnail.

3.for the tmpDir the file will upload to it, those file will delete ?

thx
Gino

@mycaule
Copy link
Collaborator

mycaule commented Dec 29, 2014

GinoToo,

  • Concerning thumbnails, they are currently only created if the options.storage.type is set to local. When set to aws, nothing is done
  • For the correct URL, I think the correct URL is //s3-{storage.aws.region}.amazonaws.com/{bucketName}/. Please confirm this, I only started to use S3 today to make some tests.

Thank you.

@arvindr21
Copy link
Owner

Hello,

To answer your questions,

1 : This is same as #16 the solution is set to the bucket name and point to region if you know. If not, leave the region out. Just in case, can you please post the config and options?

2 : As of now thumbnails are only supported in server uploads. I will need to implement this next.

3 : Looks like the delete logic is missing for AWS. Thanks for bringing it to the notice. Will fix this too.

-- Thanks.

@mycaule
Copy link
Collaborator

mycaule commented Dec 29, 2014

I think the region is mandatory. I didn't have good results on a clean installation. I tried :

  • the default value region : 'us-west-2',
  • no region set at all (undefined).

In my case setting region:'eu-west-1' and changing the get URL here to this line below solved all the problems (GET and DELETE).

url: (options.useSSL ? 'https:' : 'http:') + '//s3-'+ options.storage.aws.region+'.amazonaws.com/' + options.storage.aws.bucketName + '/' + o.Key         

A simple way to know what the region is, is to go to your Amazon S3 Managment Console with your browser and to get the parameter value in the URL.

@GinoToo
Copy link
Author

GinoToo commented Dec 29, 2014

hi arvindr21

reference for #16

http(s)://<bucket>.s3.amazonaws.com/<object>
http(s)://s3.amazonaws.com/<bucket>/<object>

for me also only work for the first one

http(s)://<bucket>.s3.amazonaws.com/<object>

no need to use the region

the code look like

url: (options.useSSL ? 'https:' : 'http:') + '//' + options.storage.aws.bucketName + '.s3.amazonaws.com/' + o.Key

here is my option

var options = {
    tmpDir:  __dirname + '/../assets/uploaded/tmp',
    uploadUrl:  '/uploaded/files/',
    maxPostSize: 11000000000, // 11 GB
    minFileSize:  1,
    maxFileSize:  10000000000, // 10 GB
    acceptFileTypes:  /.+/i,
    // Files not matched by this regular expression force a download dialog,
    // to prevent executing any scripts in the context of the service domain:
    inlineFileTypes:  /\.(gif|jpe?g|png)$/i,
    imageTypes:  /\.(gif|jpe?g|png)$/i,
    imageVersions: {
        width:  80,
        height: 80
    },
    accessControl: {
        allowOrigin: '*',
        allowMethods: 'OPTIONS, HEAD, GET, POST, PUT, DELETE',
        allowHeaders: 'Content-Type, Content-Range, Content-Disposition'
    },
    nodeStatic: {
        cache:  3600 // seconds to cache served files
    },
     storage : {
        type : 'aws',
         aws : {
            accessKeyId :  'XXXXXXXXXXXXXXXXXXXXXXXX',
            secretAccessKey : 'XXXXXXXXXXXXXXXXXXXXXXXX',
            bucketName : 'XXXXXXXXXXXXXXXXXXXXXXXX'
        }
    }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants