diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2012-09-24 20:41:00 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2012-09-24 20:41:00 +0200 |
commit | 9c915bab172a4d5a2d9aed056c9261cd7b0cbd60 (patch) | |
tree | d4a0739ba34dc6e6be86495e0f0fe2f2acc23f9f | |
parent | 3286302f7bade0029210c4942565fac905c42216 (diff) |
Delete uploaded temporary file on missing metadata.
-rwxr-xr-x | fbin.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -237,6 +237,8 @@ class Application(object): tempfile.tempdir = settings.file_directory form = FileUploadFieldStorage(fp = environ['wsgi.input'], environ = environ) if environ['REQUEST_METHOD'] != 'POST' or not 'file' in form or not 'filename' in form: + if 'file' in form: + form['file'].file.delete = True start_response('200 OK', [('Content-Type', 'text/html')]) return str(templates.upload(searchList = {'root': settings.virtual_root, 'user': user})) |