fix(remote download): improve file pre-upload validation (fix #2286)
This commit is contained in:
@@ -103,6 +103,8 @@ type (
|
||||
CompleteUpload(ctx context.Context, session *UploadSession) (File, error)
|
||||
// CancelUploadSession cancels an upload session. Delete the placeholder file if no other entity is created.
|
||||
CancelUploadSession(ctx context.Context, path *URI, sessionID string, session *UploadSession) ([]Entity, error)
|
||||
// PreValidateUpload pre-validates an upload request.
|
||||
PreValidateUpload(ctx context.Context, dst *URI, files ...PreValidateFile) error
|
||||
}
|
||||
|
||||
LockSystem interface {
|
||||
@@ -369,6 +371,12 @@ type (
|
||||
ParentFiles []int `json:"parent_files"`
|
||||
PrimaryEntityParentFiles []int `json:"primary_entity_parent_files"`
|
||||
}
|
||||
|
||||
PreValidateFile struct {
|
||||
Name string
|
||||
Size int64
|
||||
OmitName bool // if true, file name will not be validated
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user