Skip to content

Instantly share code, notes, and snippets.

@tstachl
Created August 25, 2014 17:38
Show Gist options
  • Save tstachl/e741843620fefecc95ef to your computer and use it in GitHub Desktop.
Save tstachl/e741843620fefecc95ef to your computer and use it in GitHub Desktop.
Unzip to S3
Zip::ZipFile.open(zipfile) do |zip|
zip.each do |f|
path = File.join('/your/aws/path', f.name)
aws = AWS::S3.new.buckets['yourbucket'][path]
aws.write(file: zip.get_output_stream(f))
aws_url = aws.public_url(secure: true).to_s
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment