Accidentally sending file name instead of file path (#132)
Fixes issue with file uploader, where file path value was incorrect.
This commit is contained in:
committed by
GitHub
parent
c204ebc514
commit
63cbf41221
@@ -70,9 +70,10 @@ func (a *api) attachmentHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
file, err := a.fileReader.ReadFile(attachmentRequest.FileName)
|
file, err := a.fileReader.ReadFile(attachmentRequest.FilePath)
|
||||||
if err != nil {
|
if err != nil || file == nil {
|
||||||
handleError(w, err, fmt.Sprintf("Could not read %s file", attachmentRequest.FileName), http.StatusInternalServerError)
|
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)
|
projectFile, res, err := a.client.UploadFile(a.projectInfo.ProjectId, file, attachmentRequest.FileName)
|
||||||
|
|||||||
Reference in New Issue
Block a user