From ce47bae559df59be8d8b2016cefa62c2fa00d0e2 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 17 Aug 2019 14:29:49 +0200 Subject: file_storage.filesystem: Set file mode if configured Regression since b72ecc321c315bafe40cc7406e87e088564ab8a9. This is needed eg. when using X-Sendfile so that the web server can access the files. --- fbin/file_storage/filesystem.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fbin/file_storage') diff --git a/fbin/file_storage/filesystem.py b/fbin/file_storage/filesystem.py index 3433baf..3b46e34 100644 --- a/fbin/file_storage/filesystem.py +++ b/fbin/file_storage/filesystem.py @@ -26,6 +26,9 @@ class Storage(BaseStorage): except: os.unlink(temp.name) raise + finally: + if self.app.config.get('DESTINATION_MODE'): + os.chmod(new_file.get_path(), self.app.config.get('DESTINATION_MODE')) def get_file(self, f): path = f.get_path() -- cgit v1.2.3