file DELETE support

This commit is contained in:
Wes Thomas
2016-02-10 18:42:21 -05:00
parent c66cc8d7bc
commit a75376523c
5 changed files with 142 additions and 0 deletions

View File

@@ -56,6 +56,20 @@ export class S3Adapter extends FilesAdapter {
});
}
deleteFile(config, filename) {
return new Promise((resolve, reject) => {
let params = {
Key: this._bucketPrefix + filename
};
this._s3Client.deleteObject(params, (err, data) =>{
if(err !== null) {
return reject(err);
}
resolve(data);
});
});
}
// Search for and return a file if found by filename
// Returns a promise that succeeds with the buffer result from S3
getFileData(config, filename) {