web/formfields.py
changeset 5762 730d458ec1bf
parent 5712 e136d392bd71
parent 5756 ab03e4adb4f1
child 5816 5d72fbba92e9
--- a/web/formfields.py	Wed Jun 16 09:21:49 2010 +0200
+++ b/web/formfields.py	Wed Jun 16 14:51:17 2010 +0200
@@ -82,6 +82,8 @@
     it
     """
 
+def normalize_filename(filename):
+    return filename.split('\\')[-1]
 
 def vocab_sort(vocab):
     """sort vocabulary, considering option groups"""
@@ -742,7 +744,7 @@
             value = None
         else:
             # set filename on the Binary instance, may be used later in hooks
-            value.filename = filename
+            value.filename = normalize_filename(filename)
         return value