fixed file upload error
This commit is contained in:
parent
5ea310b526
commit
38dba3747a
@ -472,7 +472,8 @@ initDb().then(() => {
|
|||||||
: `image_${timestamp}${fileExt}`
|
: `image_${timestamp}${fileExt}`
|
||||||
const outputPath = path.join(mediaDir, outputFilename);
|
const outputPath = path.join(mediaDir, outputFilename);
|
||||||
|
|
||||||
fs.renameSync(file.path, outputPath);
|
fs.copyFileSync(file.path, outputPath);
|
||||||
|
fs.unlinkSync(file.path);
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user