diff options
-rwxr-xr-x | fbin.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -236,13 +236,15 @@ class Application(object): return self.redirect(environ, start_response, 'l') if not user and not settings.allow_anonymous_uploads: - form['file'].file.delete = True + if hasattr(form['file'].file, 'delete'): + form['file'].file.delete = True start_response('403 Forbidden', [('Content-Type', 'text/plain')]) return ['Anonymous uploads are disabled by the administrator.'] filename = form.getvalue('filename') temp = form['file'].file - temp.delete = False + if hasattr(temp, 'delete'): + temp.delete = False # If the name attribute is missing, assume this is a StringIO object, then create a new temporary file and copy the contents. if not hasattr(temp, 'name'): |