Skip to content

Commit 3563dd8

Browse files
committed
Fix file upload ext
1 parent c0bcd64 commit 3563dd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

httpimages/httpimages.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (cfg *UploaderConfig) HandleImageUploadToFile(r *http.Request, fileKey stri
188188
}
189189

190190
resourceName = uuid.NewV4().String()
191-
resourcePath = path.Join(cfg.UploadsDir, resourceName, resourceExtension[0])
191+
resourcePath = path.Join(cfg.UploadsDir, fmt.Sprintf("%s%s", resourceName, resourceExtension[0]))
192192
localImage, err := os.OpenFile(resourcePath, os.O_WRONLY|os.O_CREATE, 0666)
193193
if err != nil {
194194
return "", "", "", http.StatusInternalServerError, err

0 commit comments

Comments
 (0)