From 4c1145bbb1d623c89eb5ecd82ec71dee2ef0572d Mon Sep 17 00:00:00 2001 From: JustTestCode <65500757+JustTestCode@users.noreply.github.com> Date: Sat, 19 Jun 2021 05:37:09 +0800 Subject: [PATCH] Update filer_server_handlers_write_autochunk.go add filer post file out fid Sometimes we need filer server for file management, and we also need fid for direct access and bypass the filer server, I think fid output is necessary --- weed/server/filer_server_handlers_write_autochunk.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weed/server/filer_server_handlers_write_autochunk.go b/weed/server/filer_server_handlers_write_autochunk.go index fcb92d8ec..54922af7c 100644 --- a/weed/server/filer_server_handlers_write_autochunk.go +++ b/weed/server/filer_server_handlers_write_autochunk.go @@ -208,10 +208,14 @@ func (fs *FilerServer) saveMetaData(ctx context.Context, r *http.Request, fileNa return } entry.Chunks = mergedChunks - + var fids []string + for _, value := range entry.Chunks { + fids = append(fids, value.FileId) + } filerResult = &FilerPostResult{ Name: fileName, Size: int64(entry.FileSize), + Fid: strings.Join(fids, "|"), } if entry.Extended == nil {