mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Web editor: support upload files
This commit is contained in:
parent
7c31f235da
commit
643142acab
24 changed files with 503 additions and 600 deletions
|
@ -447,7 +447,6 @@ func UploadIssueAttachment(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
allowedTypes := strings.Split(setting.AttachmentAllowedTypes, ",")
|
||||
file, header, err := ctx.Req.FormFile("file")
|
||||
if err != nil {
|
||||
ctx.Error(500, fmt.Sprintf("FormFile: %v", err))
|
||||
|
@ -462,6 +461,7 @@ func UploadIssueAttachment(ctx *context.Context) {
|
|||
}
|
||||
fileType := http.DetectContentType(buf)
|
||||
|
||||
allowedTypes := strings.Split(setting.AttachmentAllowedTypes, ",")
|
||||
allowed := false
|
||||
for _, t := range allowedTypes {
|
||||
t := strings.Trim(t, " ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue