Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]file 类型的表单不能指定特定的 uploader 么? #649

Open
xmwilldo opened this issue Jan 22, 2025 · 1 comment
Open

Comments

@xmwilldo
Copy link

xmwilldo commented Jan 22, 2025

Description [describe your questions]

file 类型的表单不能指定特定的 uploader 么?因为需要上传到不同的目录,所以不想就用系统启动后指定的uploader,或者有什么别的办法可以实现上传到不同的目录?

Example code [If you have any code info]

formList.AddField("目标icon", "target_icon", db.Varchar, form.File).
FieldDisplay(func(value types.FieldModel) interface{} {
if value.Value == "" {
return ""
} else {
return fmt.Sprintf("https://%s/%s", l.svcCtx.Config.AliOSS.Domain, value.Value)
}
}).
FieldMust().
FieldDefault(fmt.Sprintf("%s/image/default.png", l.svcCtx.Config.AliOSS.Target))

Others [screenshots or other info]

@gu817
Copy link

gu817 commented Mar 21, 2025

Image
我想这样,每天都有自己的目录,可是在上传的时候系统不会把文件放入到指定的目录,还是放入到 uploads 目录,但是数据图片的路径加上了时间,有没有解决方案

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants