This is the code I\'m working from
import sys
import boto
import boto.s3
# AWS ACCESS DETAILS
AWS_ACCESS_KEY_ID = \'\'
AWS_SECRET_ACCESS_KEY = \'\'
bucket_
All you should have to do is prepend the virtual directory path to the key name prior to uploading. For example:
key_name = 'my test file'
path = 'images/holiday'
full_key_name = os.path.join(path, key_name)
k = bucket.new_key(full_key_name)
k.set_contents_from_filename(...)
You may have to change that a bit for your application but hopefully that gives you the basic idea.