got team upload working
This commit is contained in:
@@ -141,17 +141,7 @@ def handle_uploaded_image(i): # pragma: no cover
|
||||
|
||||
|
||||
def handle_uploaded_file(f):
|
||||
fname = f.name
|
||||
if hasattr(f, 'temporary_file_path'):
|
||||
file_path = f.temporary_file_path()
|
||||
else:
|
||||
import tempfile
|
||||
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
|
||||
for chunk in f.chunks():
|
||||
temp_file.write(chunk)
|
||||
file_path = temp_file.name
|
||||
return fname, file_path
|
||||
|
||||
fname = f.name
|
||||
ext = fname.split('.')[-1]
|
||||
fname = '%s.%s' % (uuid.uuid4(), ext)
|
||||
fname2 = 'media/'+fname
|
||||
|
||||
Reference in New Issue
Block a user