web client: use fetch to upload files

also add REST API to upload a single file as POST body
This commit is contained in:
Nicola Murino
2021-12-08 19:25:22 +01:00
parent 5b4ef0ee3b
commit c153330ab8
19 changed files with 851 additions and 161 deletions

View File

@@ -348,6 +348,15 @@ func (u *User) GetPermissionsForPath(p string) []string {
return permissions
}
// HasBufferedSFTP returns true if the user has a SFTP filesystem with buffering enabled
func (u *User) HasBufferedSFTP(name string) bool {
fs := u.GetFsConfigForPath(name)
if fs.Provider == sdk.SFTPFilesystemProvider {
return fs.SFTPConfig.BufferSize > 0
}
return false
}
func (u *User) getForbiddenSFTPSelfUsers(username string) ([]string, error) {
sftpUser, err := UserExists(username)
if err == nil {