Browse files

Make sure to get a storage dependent valid file name when handling up…

…loaded files.
  • Loading branch information...
1 parent dfae5ff commit e244b48d6d8d6a5ce442c06af1cae65db9bbe531 @charettes charettes committed Jan 25, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 form_designer/uploads.py
View
3 form_designer/uploads.py
@@ -42,7 +42,8 @@ def handle_uploaded_files(form_definition, form):
uploaded_file = form.cleaned_data.get(field.name, None)
if uploaded_file is None:
continue
- root, ext = os.path.splitext(uploaded_file.name)
+ valid_file_name = storage.get_valid_name(uploaded_file.name)
+ root, ext = os.path.splitext(valid_file_name)
filename = storage.get_available_name(
os.path.join(app_settings.FILE_STORAGE_DIR,
form_definition.name,

0 comments on commit e244b48

Please sign in to comment.