From 63cbf41221c7168a22d035d95755fe95c45fdc93 Mon Sep 17 00:00:00 2001 From: "Harrison (Harry) Cramer" <32515581+harrisoncramer@users.noreply.github.com> Date: Mon, 4 Dec 2023 16:06:21 -0500 Subject: [PATCH] Accidentally sending file name instead of file path (#132) Fixes issue with file uploader, where file path value was incorrect. --- cmd/attachment.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/attachment.go b/cmd/attachment.go index 556f533..b8941d1 100644 --- a/cmd/attachment.go +++ b/cmd/attachment.go @@ -70,9 +70,10 @@ func (a *api) attachmentHandler(w http.ResponseWriter, r *http.Request) { return } - file, err := a.fileReader.ReadFile(attachmentRequest.FileName) - if err != nil { + file, err := a.fileReader.ReadFile(attachmentRequest.FilePath) + if err != nil || file == nil { handleError(w, err, fmt.Sprintf("Could not read %s file", attachmentRequest.FileName), http.StatusInternalServerError) + return } projectFile, res, err := a.client.UploadFile(a.projectInfo.ProjectId, file, attachmentRequest.FileName)