Uploads: Implement range for google storage read

pull/6788/head
Rodrigo Nascimento 9 years ago
parent 69a76ceb49
commit e14e73d087
  1. 15
      packages/rocketchat-file-upload/ufs/GoogleStorage/server.js

@ -83,9 +83,18 @@ export class GoogleStorageStore extends UploadFS.Store {
* @param options
* @return {*}
*/
this.getReadStream = function(fileId, file/*, options = {}*/) {
// TODO range?
return this.bucket.file(this.getPath(file)).createReadStream();
this.getReadStream = function(fileId, file, options = {}) {
const config = {};
if (options.start != null) {
config.start = options.start;
}
if (options.end != null) {
config.end = options.end;
}
return this.bucket.file(this.getPath(file)).createReadStream(config);
};
/**

Loading…
Cancel
Save