I am trying to upload an entire directory to s3 using the ruby aws-sdk gem. I am first trying to break it down in to smaller problems so what I am currently trying to do is simply create one single folder and then place a file inside of that folder. I know that technically s3 does not have folders, but objects. I do know that you can have a directory-like structure though. I can not find anything on how to do this online and the docs don't mention a lot about directory structure besides reading with AWS::S3::Tree
This is my current attempt at creating a folder and then adding a file to the folder:
#created an object called test
obj = bucket.objects.create('test', 'data')
#this is the path to a css file that I am uploading.
path_to_file = './directory/mobile/player.css'
#writing file to test object
obj.write(Pathname.new(path_to_file))
What this is actually doing is writing the css file to test. What I want it to do is create a css file inside a folder named test.
I am sure I am misunderstanding the way objects are related to directories. Can anyone spot where I am going wrong or point me in the correct direction?