Send the content type through to the cloud engines.

This commit is contained in:
Jake Moshenko 2014-09-09 16:52:53 -04:00
parent 29d40db5ea
commit 756e8ec848
5 changed files with 20 additions and 8 deletions

View file

@ -33,8 +33,10 @@ class UserfilesHandlers(View):
# encoding (Gunicorn)
input_stream = request.environ['wsgi.input']
c_type = request.headers.get('Content-Type', None)
path = self._files.get_file_id_path(file_id)
self._storage.stream_write(self._locations, path, input_stream)
self._storage.stream_write(self._locations, path, input_stream, c_type)
return make_response('Okay')
@ -78,7 +80,7 @@ class DelegateUserfiles(object):
def store_file(self, file_like_obj, content_type):
file_id = str(uuid4())
path = self.get_file_id_path(file_id)
self._storage.stream_write(self._locations, path, file_like_obj)
self._storage.stream_write(self._locations, path, file_like_obj, content_type)
return file_id
def get_file_url(self, file_id, expires_in=300, requires_cors=False):