diff --git a/internal/httpd/api_shares.go b/internal/httpd/api_shares.go index d742cf67..531c5930 100644 --- a/internal/httpd/api_shares.go +++ b/internal/httpd/api_shares.go @@ -357,6 +357,13 @@ func (s *httpdServer) uploadFileToShare(w http.ResponseWriter, r *http.Request) return } defer common.Connections.Remove(connection.GetID()) + + if getBoolQueryParam(r, "mkdir_parents") { + if err = connection.CheckParentDirs(path.Dir(filePath)); err != nil { + sendAPIResponse(w, r, err, "Error checking parent directories", getMappedStatusCode(err)) + return + } + } if err := doUploadFile(w, r, connection, filePath); err != nil { dataprovider.UpdateShareLastUse(&share, -1) //nolint:errcheck } diff --git a/static/locales/en/translation.json b/static/locales/en/translation.json index 1ae2008b..8fd39e89 100644 --- a/static/locales/en/translation.json +++ b/static/locales/en/translation.json @@ -360,7 +360,7 @@ "err_403": "$t(fs.upload.err_generic). $t(fs.err_403)", "err_429": "$t(fs.upload.err_generic). $t(fs.err_429)", "err_dir_overwrite": "$t(fs.upload.err_generic). There are directories with the same name as the files: {{- val}}", - "overwrite_text": "File conflict detected. Do you want to overwrite the following files?" + "overwrite_text": "Conflict detected. Do you want to overwrite the following files/directories?" }, "quota_usage": { "title": "Quota usage", diff --git a/static/locales/it/translation.json b/static/locales/it/translation.json index c6dc0bc6..447994ee 100644 --- a/static/locales/it/translation.json +++ b/static/locales/it/translation.json @@ -360,7 +360,7 @@ "err_403": "$t(fs.upload.err_generic). $t(fs.err_403)", "err_429": "$t(fs.upload.err_generic). $t(fs.err_429)", "err_dir_overwrite": "$t(fs.upload.err_generic). Ci sono cartelle con lo stesso nome dei file: {{- val}}", - "overwrite_text": "Rilevato conflitto di file. Vuoi sovrascrivere i seguenti file?" + "overwrite_text": "Rilevato conflitto. Vuoi sovrascrivere i seguenti file/cartelle?" }, "quota_usage": { "title": "Utilizzo quota", diff --git a/templates/common/base.html b/templates/common/base.html index e2c1a6fc..df281ecc 100644 --- a/templates/common/base.html +++ b/templates/common/base.html @@ -341,6 +341,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). .shortcut { font-family: monospace; color: #666; } + + .overflow-auto { + overflow: auto; + } + .visibility-auto { + content-visibility: auto; + } {{- end}} diff --git a/templates/webadmin/admins.html b/templates/webadmin/admins.html index 0e9e02c0..e650fa4d 100644 --- a/templates/webadmin/admins.html +++ b/templates/webadmin/admins.html @@ -227,6 +227,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/connections.html b/templates/webadmin/connections.html index ff9ac14e..10406a44 100644 --- a/templates/webadmin/connections.html +++ b/templates/webadmin/connections.html @@ -127,6 +127,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/defender.html b/templates/webadmin/defender.html index cfdf4c29..2a553d99 100644 --- a/templates/webadmin/defender.html +++ b/templates/webadmin/defender.html @@ -132,6 +132,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/eventactions.html b/templates/webadmin/eventactions.html index e78dba57..1475eff1 100644 --- a/templates/webadmin/eventactions.html +++ b/templates/webadmin/eventactions.html @@ -132,6 +132,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/eventrules.html b/templates/webadmin/eventrules.html index 4dcaf544..7b1a22b7 100644 --- a/templates/webadmin/eventrules.html +++ b/templates/webadmin/eventrules.html @@ -183,6 +183,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/folders.html b/templates/webadmin/folders.html index 3a10d975..eed87bdc 100644 --- a/templates/webadmin/folders.html +++ b/templates/webadmin/folders.html @@ -164,6 +164,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/groups.html b/templates/webadmin/groups.html index 049eec8e..4c1271d1 100644 --- a/templates/webadmin/groups.html +++ b/templates/webadmin/groups.html @@ -150,6 +150,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/iplists.html b/templates/webadmin/iplists.html index 5facdc7b..78e08665 100644 --- a/templates/webadmin/iplists.html +++ b/templates/webadmin/iplists.html @@ -263,6 +263,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: handleResponseData, error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/roles.html b/templates/webadmin/roles.html index 6a726796..20c487cd 100644 --- a/templates/webadmin/roles.html +++ b/templates/webadmin/roles.html @@ -151,6 +151,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webadmin/users.html b/templates/webadmin/users.html index 8800369b..a0b1b773 100644 --- a/templates/webadmin/users.html +++ b/templates/webadmin/users.html @@ -279,6 +279,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). dataSrc: "", error: function ($xhr, textStatus, errorThrown) { $(".dataTables_processing").hide(); + $('#loader').addClass("d-none"); let txt = ""; if ($xhr) { let json = $xhr.responseJSON; diff --git a/templates/webclient/files.html b/templates/webclient/files.html index 6fa538aa..512e8bf9 100644 --- a/templates/webclient/files.html +++ b/templates/webclient/files.html @@ -159,7 +159,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).