mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 10:44:37 +00:00
Workaround for file upload problem when the file name contains Umlaute (seems to be a Linux only issue, fixes #1382)
This commit is contained in:
@@ -44,9 +44,9 @@ Grocy.Components.UserfieldsForm.Save = function(success, error)
|
||||
if (input[0].files.length > 0)
|
||||
{
|
||||
// Files service requires an extension
|
||||
var fileName = RandomString() + '.' + input[0].files[0].name.split('.').reverse()[0];
|
||||
var fileName = RandomString() + '.' + CleanFileName(input[0].files[0].name.split('.').reverse()[0]);
|
||||
|
||||
jsonData[fieldName] = btoa(fileName) + '_' + btoa(input[0].files[0].name);
|
||||
jsonData[fieldName] = btoa(fileName) + '_' + btoa(CleanFileName(input[0].files[0].name));
|
||||
Grocy.Api.UploadFile(input[0].files[0], 'userfiles', fileName,
|
||||
function(result)
|
||||
{
|
||||
|
Reference in New Issue
Block a user