X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/040285e94b385dd57a003a4fe5b693c299fe921b..440a9c4126fbfb66c90747887b9df6a006c62f8f:/src/fileupload/views.py?ds=sidebyside diff --git a/src/fileupload/views.py b/src/fileupload/views.py index 3e6b999e..56a198ed 100644 --- a/src/fileupload/views.py +++ b/src/fileupload/views.py @@ -1,3 +1,6 @@ +# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import json import os from urllib.parse import quote @@ -129,7 +132,7 @@ class UploadView(FormView): os.makedirs(path) data = [] for f in flist: - with open(self.get_safe_path(f.name), 'w') as destination: + with open(self.get_safe_path(f.name), 'wb') as destination: for chunk in f.chunks(): destination.write(chunk) data.append({