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

How to save file to public folder in s3? #5

Closed
vlradovanovic opened this issue Jan 30, 2017 · 1 comment
Closed

How to save file to public folder in s3? #5

vlradovanovic opened this issue Jan 30, 2017 · 1 comment

Comments

@vlradovanovic
Copy link

Can I store files in 'public' folder of my s3 bucket?
Via settings that you wrote my files are stored in root od a bucket.
(https://s3://[BUCKEET-NAME]).s3.amazonaws.com), but I want my files to be stored on
(https://s3://[BUCKEET-NAME]).s3.amazonaws.com/public/)...

@OriginalEXE
Copy link
Owner

OriginalEXE commented Feb 2, 2017

Hi,

when instantiating the storage, you can pass to it a destination, like so:

const s3 = require( 'multer-storage-s3' );
const storage = s3({
  destination : ( req, file, cb ) => { cb( 'public' ); }
});

I believe that should work.

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

No branches or pull requests

2 participants