diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2012-09-04 19:40:56 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2012-09-04 19:40:56 +0200 |
commit | 10a0b39a0756d969b9f6062524f8e9d7c068a4fa (patch) | |
tree | 208b8ac47d2309e417a6d6886c0497f4c85c07f6 | |
parent | 026dd78098b24b206518357365d6f22c3e5715b4 (diff) |
Optionally change file mode after uploading.
-rwxr-xr-x | fbin.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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: |