When you do
jpg_data = response.read()
I believe boto loses the information about the file extension, which it uses to guess the mimetype. So by the time you store it with
my_file.write(jpg_data)
all boto/S3 knows is that it has some sort of binary data to write.
If you replace these lines in your program:
storage = S3BotoStorage(bucket='icanhazbukkit')
my_file = storage.open(path_to_new_file, 'w')
my_file.write(jpg_data)
my_file.close()
with
bucket = conn.create_bucket('icanhazbukkit')
k = Key(bucket)
k.name = "yourfilename"
header = {'Content-Type' : 'image/jpeg'}
k.set_contents_from_string(jpg_data, header)
You can control the Content-Type by specifying it with the header param
If you want to preserve the Content-Type from your original get, you can do this:
request = urllib2.Request('http://link.to/file.jpg')
response = urllib2.urlopen(request)
file_data = response.read()
bucket = conn.create_bucket('icanhazbukkit')
k = Key(bucket)
k.name = "yourfilename"
origType = response.info().gettype()
header = {'Content-Type' : origType}
k.set_contents_from_string(file_data, header)