From cbcf7ff647e803f67c470f5792061a88b7d8ede3 Mon Sep 17 00:00:00 2001 From: teddiesloco Date: Fri, 28 Aug 2026 19:18:43 +0700 Subject: [PATCH] fix(file): use path.Join instead of filepath.Join for object storage keys (#629) --- backend/modules/foundation/domain/file/service/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/modules/foundation/domain/file/service/server.go b/backend/modules/foundation/domain/file/service/server.go index 67bee34e1a..8b0ed0996a 100644 --- a/backend/modules/foundation/domain/file/service/server.go +++ b/backend/modules/foundation/domain/file/service/server.go @@ -13,6 +13,7 @@ import ( "mime/multipart" "net/http" "net/url" + "path" "path/filepath" "time" @@ -50,7 +51,7 @@ func (fs fileService) UploadLoopFile(ctx context.Context, fileHeader *multipart. if fileName == "" { return "", errorx.NewByCode(errno.CommonInvalidParamCode) } - fileName = filepath.Join(spaceID, "/", fileName) + fileName = path.Join(spaceID, fileName) f, err := fileHeader.Open() if err != nil { @@ -131,7 +132,7 @@ func (fs fileService) UploadFileForServer(ctx context.Context, mimeType string, } // Build full path with workspace ID - fullPath := filepath.Join(spaceID, "/", fileName) + fullPath := path.Join(spaceID, fileName) // Detect content type from file data fileContentType := http.DetectContentType(body)