pass filename (it is not part of the config!)

This commit is contained in:
Girish Ramakrishnan
2016-03-31 09:53:56 -07:00
parent fc11484b51
commit 3ea2070cdb
3 changed files with 7 additions and 5 deletions

View File

@@ -79,9 +79,10 @@ function getSignedUploadUrl(apiConfig, filename, callback) {
});
}
function getSignedDownloadUrl(apiConfig, info, callback) {
function getSignedDownloadUrl(apiConfig, info, filename, callback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof info, 'object');
assert.strictEqual(typeof filename, 'string');
assert.strictEqual(typeof callback, 'function');
if (!info.bucket || !info.prefix) return new Error('Invalid configuration'); // prevent error in s3
@@ -93,7 +94,7 @@ function getSignedDownloadUrl(apiConfig, info, callback) {
var params = {
Bucket: info.bucket,
Key: info.prefix + '/' + info.filename,
Key: info.prefix + '/' + filename,
Expires: 60 * 30 /* 30 minutes */
};