Skip to content

Commit

Permalink
fix: copy image uploads instead of rename, because we cant be sure of…
Browse files Browse the repository at this point in the history
… fs layout
  • Loading branch information
chrisbenincasa committed Nov 22, 2024
1 parent d6448e2 commit 8af83e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ export const apiRouter: RouterPluginAsyncCallback = async (fastify) => {
// createWriteStream(path.join(baseDir, data.filename)),
// );

await fsPromises.rename(data.filepath, path.join(baseDir, data.filename));
await fsPromises.copyFile(
data.filepath,
path.join(baseDir, data.filename),
);

return res.send({
status: true,
Expand Down

0 comments on commit 8af83e7

Please sign in to comment.