From 47547d6d8d5c82f6beb7779b69039ffc23de5925 Mon Sep 17 00:00:00 2001 From: Aykut Yaman Date: Fri, 20 Jun 2014 12:49:11 +0300 Subject: [PATCH] added x-amz-acl support --- server/Uploader.coffee | 4 ++++ server/server.coffee | 1 + 2 files changed, 5 insertions(+) diff --git a/server/Uploader.coffee b/server/Uploader.coffee index 02705d4..81f61a3 100644 --- a/server/Uploader.coffee +++ b/server/Uploader.coffee @@ -2,6 +2,10 @@ class @Uploader _configuration: null @config: (config) -> @_configuration = config + _aclList = ["private", "public-read", "public-read-write", "authenticated-read", + "bucket-owner-read", "bucket-owner-full-control"] + config.acl = config.acl or "private" + throw new Meteor.Error("Unknown acl param!") unless config.acl in _aclList @getConfig: -> if @_configuration? diff --git a/server/server.coffee b/server/server.coffee index a278e1d..7e8d483 100644 --- a/server/server.coffee +++ b/server/server.coffee @@ -30,6 +30,7 @@ Meteor.methods headers = "Content-Type": file.type "Content-Length": buffer.length + "x-amz-acl": config.acl # Pipe file buffer to cloud put = knox.putStream file_stream_buffer, path, headers, (error, response) ->