mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-12-18 10:14:00 +08:00
Feat: use goroutine to detect upload-canceling action / Object name validate
This commit is contained in:
@@ -11,6 +11,11 @@ func GenericBeforeUpload(ctx context.Context, fs *FileSystem, file FileData) err
|
||||
return FileSizeTooBigError
|
||||
}
|
||||
|
||||
// 验证文件名
|
||||
if !fs.ValidateLegalName(ctx, file.GetFileName()) {
|
||||
return IlegalObjectNameError
|
||||
}
|
||||
|
||||
// 验证扩展名
|
||||
if !fs.ValidateExtension(ctx, file.GetFileName()) {
|
||||
return FileExtensionNotAllowedError
|
||||
|
||||
Reference in New Issue
Block a user