From 3a52886c147323d227fee78874e6d85eedf43bd4 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 6 May 2013 18:37:28 +0200 Subject: Fixed hashing when uploading very small files. --- fbin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fbin.py b/fbin.py index 02200e2..d3d84c8 100755 --- a/fbin.py +++ b/fbin.py @@ -249,6 +249,7 @@ class Application(object): if not hasattr(temp, 'name'): new_temp = tempfile.NamedTemporaryFile(prefix = 'upload_', dir = settings.file_directory, delete = False) new_temp.write(temp.getvalue()) + new_temp.seek(0) temp = new_temp m = hashlib.md5() -- cgit v1.2.3