From 10a0b39a0756d969b9f6062524f8e9d7c068a4fa Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 4 Sep 2012 19:40:56 +0200 Subject: Optionally change file mode after uploading. --- fbin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fbin.py b/fbin.py index bd025c0..7667414 100755 --- a/fbin.py +++ b/fbin.py @@ -94,6 +94,8 @@ class Application(object): hash = ''.join(random.choice(base62_alphabet) for x in xrange(5)) new_path = os.path.join(settings.file_directory, hash + os.path.splitext(filename)[1]) os.rename(path, new_path) + if hasattr(settings, 'destination_mode'): + os.chmod(new_path, settings.destination_mode) session = db.Session() try: -- cgit v1.2.3