diff --git a/api/views.py b/api/views.py index 0434fec..7b6ef08 100644 --- a/api/views.py +++ b/api/views.py @@ -443,7 +443,11 @@ def NCSwitchStandardFiles(request): standard = Standards.objects.get(pk=request.GET.get('standardid')) response_status = "OK" for f in standard.addedfiles.all(): - filesearchdata = '/files/' + settings.NEXTCLOUD_USER_API + '/Agenturdaten_' + str(standard.agency.pk) + 'infinity' + str(f.name).encode('UTF-8') + '' + + file_name_normal = str(f.name).encode('UTF-8') + file_name_normal_utf8 = file_name_normal.decode('UTF-8') + + filesearchdata = '/files/' + settings.NEXTCLOUD_USER_API + '/Agenturdaten_' + str(standard.agency.pk) + 'infinity' + file_name_normal_utf8 + '' r = requests.request("SEARCH", settings.NEXTCLOUD_URL + "remote.php/dav", data=filesearchdata, auth=(settings.NEXTCLOUD_USER_API, settings.NEXTCLOUD_PW_API), headers={'Content-Type' : 'text/xml'}) fileid = getFileIdFromXML(r.text) if(fileid == None):