diff --git a/server/pkg/controller/file.go b/server/pkg/controller/file.go index a4ac4b1b7..02d2cad64 100644 --- a/server/pkg/controller/file.go +++ b/server/pkg/controller/file.go @@ -64,8 +64,11 @@ func (c *FileController) validateFileCreateOrUpdateReq(userID int64, file ente.F if !strings.HasPrefix(file.File.ObjectKey, objectPathPrefix) || !strings.HasPrefix(file.Thumbnail.ObjectKey, objectPathPrefix) { return stacktrace.Propagate(ente.ErrBadRequest, "Incorrect object key reported") } - if file.EncryptedKey == "" || file.KeyDecryptionNonce == "" { - return stacktrace.Propagate(ente.ErrBadRequest, "EncryptedKey and KeyDecryptionNonce are required") + // Check for attributes for fileCreation. We don't send key details on update + if file.ID == 0 { + if file.EncryptedKey == "" || file.KeyDecryptionNonce == "" { + return stacktrace.Propagate(ente.ErrBadRequest, "EncryptedKey and KeyDecryptionNonce are required") + } } if file.File.DecryptionHeader == "" || file.Thumbnail.DecryptionHeader == "" { return stacktrace.Propagate(ente.ErrBadRequest, "DecryptionHeader for file & thumb is required")