Skip to content

Instantly share code, notes, and snippets.

@stomita
Last active January 1, 2016 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stomita/8121062 to your computer and use it in GitHub Desktop.
Save stomita/8121062 to your computer and use it in GitHub Desktop.
View link click handler to get signed URL for the file.
function initEventHandlers() {
// ...
//
$('#fileList').on('click', 'a.view-link', function() {
var key = $(this).parents('li').data('key');
bucket.getSignedUrl('getObject', { Key: key }, function (err, url) {
window.open(url, '_blank');
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment