Add content disposition to S3 uploader

This commit is contained in:
Eric Schultz 2018-08-08 12:50:58 -05:00 committed by Eric Schultz
parent 26704b1d94
commit a0567a1d96

View file

@ -15,8 +15,9 @@ module ChunkedUploader
object = bucket.objects[path]
io = StringIO.new('', 'w')
content_type = metadata[:content_type] ? metadata[:content_type] : nil
content_disposition = metadata[:content_disposition] ? metadata[:content_disposition] : nil
begin
object.multipart_upload(:acl => :public_read, :content_type => content_type) do |upload|
object.multipart_upload(:acl => :public_read, :content_type => content_type, content_disposition: content_disposition) do |upload|
chunk_enum.each do |chunk|
export_returned = io.write(chunk)
if (io.size >= MINIMUMBUFFER_SIZE)