From 016ac8ef5761cf9f296fed99b2324f88fadd41a6 Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Sat, 5 Dec 2020 17:13:38 -0800 Subject: [PATCH] Fix index generation error --- files.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files.go b/files.go index eee9376..504f0aa 100644 --- a/files.go +++ b/files.go @@ -75,7 +75,7 @@ func SendFiles(dir string) { // If the file is not the key if !strings.Contains(file.Name(), "key.aes") { // Append the file path to indexSlice - indexSlice = append(indexSlice, dir + "/" + file.Name()) + indexSlice = append(indexSlice, file.Name()) } } // Join index slice into string @@ -142,7 +142,7 @@ func RecvFiles(senderAddr string) { // If server responded with 200 OK if response.StatusCode == http.StatusOK { // Create new file at index filepath - newFile, err := os.Create(file) + newFile, err := os.Create(opensendDir + "/" + file) if err != nil { log.Fatal().Err(err).Msg("Error creating file") } // Copy response body to new file bytesWritten, err := io.Copy(newFile, response.Body)