代码初始化
This commit is contained in:
@@ -55,6 +55,15 @@ func SaveUploadedFiles(r *ghttp.Request) ([]string, error) {
|
||||
return saved, nil
|
||||
}
|
||||
|
||||
// SaveUploadedFilesFromCtx 从请求上下文中获取上传文件并保存
|
||||
func SaveUploadedFilesFromCtx(ctx context.Context) ([]string, error) {
|
||||
r := g.RequestFromCtx(ctx)
|
||||
if r == nil {
|
||||
return nil, fmt.Errorf("无法获取请求上下文")
|
||||
}
|
||||
return SaveUploadedFiles(r)
|
||||
}
|
||||
|
||||
func getTempDir(ctx context.Context) string {
|
||||
tempDir := g.Cfg().MustGet(ctx, "ffmpeg.temp_dir", "resource/temp").String()
|
||||
if tempDir == "" {
|
||||
|
||||
Reference in New Issue
Block a user