diff --git a/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go b/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go index c4ac672..ae2782a 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go +++ b/backend/app/api/handlers/v1/v1_ctrl_items_attachments.go @@ -4,6 +4,7 @@ import ( "errors" "net/http" "path/filepath" + "strings" "github.com/hay-kot/homebox/backend/internal/core/services" "github.com/hay-kot/homebox/backend/internal/data/ent/attachment" @@ -70,7 +71,7 @@ func (ctrl *V1Controller) HandleItemAttachmentCreate() errchain.HandlerFunc { // Attempt to auto-detect the type of the file ext := filepath.Ext(attachmentName) - switch ext { + switch strings.ToLower(ext) { case ".jpg", ".jpeg", ".png", ".webp", ".gif", ".bmp", ".tiff": attachmentType = attachment.TypePhoto.String() default: