changeset 4433:a499a137ecf5

fix saving of drawings to use WSGI/werkzeug API correctly, try 2
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 24 Nov 2008 00:34:31 +0100
parents 253a1e691b19
children 56f985bff6cf
files MoinMoin/action/AttachFile.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Mon Nov 24 00:24:45 2008 +0100
+++ b/MoinMoin/action/AttachFile.py	Mon Nov 24 00:34:31 2008 +0100
@@ -593,7 +593,7 @@
         # This might happen when trying to upload file names
         # with non-ascii characters on Safari.
         return _("No file content. Delete non ASCII characters from the file name and try again.")
-
+    filecontent = file_upload.stream
     filename = request.form['filename']
 
     basepath, basename = os.path.split(filename)
@@ -605,10 +605,10 @@
 
     if ext == '.draw':
         _addLogEntry(request, 'ATTDRW', pagename, basename + ext)
-        filecontent = file_upload.stream.read() # read file completely into memory
+        filecontent = filecontent.read() # read file completely into memory
         filecontent = filecontent.replace("\r", "")
     elif ext == '.map':
-        filecontent = file_upload.stream.read() # read file completely into memory
+        filecontent = filecontent.read() # read file completely into memory
         filecontent = filecontent.strip()
 
     if filecontent: