summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2012-09-04 19:40:56 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2012-09-04 19:40:56 +0200
commit10a0b39a0756d969b9f6062524f8e9d7c068a4fa (patch)
tree208b8ac47d2309e417a6d6886c0497f4c85c07f6
parent026dd78098b24b206518357365d6f22c3e5715b4 (diff)
Optionally change file mode after uploading.
-rwxr-xr-xfbin.py2
1 files changed, 2 insertions, 0 deletions
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: