Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Commit

Permalink
patch: error to download temp file from uploader (workadventure#3151)
Browse files Browse the repository at this point in the history
  • Loading branch information
gparant authored Mar 21, 2023
1 parent b996c4e commit 1f92111
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions uploader/src/Controller/FileController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ export class FileController {
downloadAudioMessage(){
this.App.get("/download-audio-message/:id", (request, response) => {
const id = request.params['id'];
const targetDevice = new HttpResponseDevice(id, response);
uploaderService.copyFile(id, targetDevice);
uploaderService.getTemp(id).then((buffer) => {
const targetDevice = new HttpResponseDevice(id, response);
return targetDevice.copyFromBuffer(buffer);
}).catch((e) => {
console.error(e);
return response.status(500).send("Internal server error");
});
});
}

Expand Down

0 comments on commit 1f92111

Please sign in to comment.