Skip to content

Instantly share code, notes, and snippets.

@nitinstp23
Created February 28, 2017 06:34
Show Gist options
  • Save nitinstp23/1174f3837543f469c6de484e06eef361 to your computer and use it in GitHub Desktop.
Save nitinstp23/1174f3837543f469c6de484e06eef361 to your computer and use it in GitHub Desktop.

Steps - Web (JavaScript)

  • Get AWS SDK for JavaScript and configure it from following steps from this AWS Guide.

  • Sample code to generate pre-signed URL:

    var s3 = new AWS.S3();
    var params = {Bucket: 'myBucket', Key: 'myKey'};
    s3.getSignedUrl('getObject', params, function (err, url) {
      console.log("The URL is", url);
    });
    
  • Ref: from this AWS Guide.


Steps - Android

  • Get AWS SDK for Android and configure it from following steps from this AWS Guide.
  • Follow steps mentioned in this AWS Guide which has sample code and full working example for generating pre-signed URLs.

Steps - iOS - ObjectiveC


NOTE:
  • Any Presigned URL generated will be valid for 15 mins.

  • Image Data Format:

{
  "image": "{\"id\":\"image-unique-name.jpg\",\"storage\":\"cache\",\"metadata\":{\"size\":83156,\"filename\":\"original-file-name.jpg\",\"mime_type\":\"image/jpeg\"}}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment