dpd-s3

get a signed Url for Put, Get file in AWS S3 in deployd

dpd-s3

get a signed Url for Put, Get file in AWS S3

This module requires deployd ~0.7.0.

If you haven't used Deployd before, make sure to read the documentation.

npm install dpd-s3

If you have a package.json, you'll have to add this module in it.

npm install dpd-s3 --save

Once it is installed, Deployd will automatically load it.
For more information about Modules, take a look at the module page on the deployd documentation.

It is a simple aws-sdk wrapper for deployd

Require:

  • AWS Access Key
  • AWS Access Secret
  • S3 Region
  • S3 bucket

Please fill them in using the deployd dashboard config page of this module.

Put signedUrl

dpd.s3bucket.get('apple.jpg', {
    signedUrl: 'Put'
    ContentType: 'image/jpeg'
}, function(signedUrl, err){
 
    // regular http put file to signedUrl
    $.ajax({type:'Put', url:signedUrl}, ...);
 
})

Get signedUrl

<img src="/s3bucket/apple.jpg" />
 
OR
 
dpd.s3bucket.get('apple.jpg', {
    returnFormat: 'Url'
}, function(signedUrl, err){
    console.log(signedUrl);
})

Get signedUrl

dpd.s3bucket.delete('apple.jpg', function(ret, err){
    console.log(ret, err);
})

Just send me a Pull Request in Github.

  • 0.1.0: refactor to use aws-sdk and signedUrl instead of direct upload

Eric Fong cowgp dallonf