From 3f961f9924a7b458e8ebb00b7135f013d52ce8d2 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 27 May 2014 09:34:01 +0200 Subject: [PATCH 1/1] Another unicode/path fix. --- apps/fileupload/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/fileupload/views.py b/apps/fileupload/views.py index cb7873b6..e4baf026 100644 --- a/apps/fileupload/views.py +++ b/apps/fileupload/views.py @@ -4,6 +4,7 @@ from urllib import quote from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, Http404 from django.utils.decorators import method_decorator +from django.utils.encoding import smart_bytes from django.views.decorators.vary import vary_on_headers from django.views.generic import FormView, View from .forms import UploadForm @@ -74,6 +75,7 @@ class UploadView(FormView): Makes sure it's inside MEDIA_ROOT. """ + filename = smart_bytes(filename) path = os.path.abspath(os.path.join( settings.MEDIA_ROOT, self.get_directory(), -- 2.20.1