forked from mirror/MCSManager
fix cross-device rename
fix for `Error: EXDEV: cross-device link not permitted`
This commit is contained in:
parent
2879724737
commit
839772a089
@ -157,7 +157,7 @@ router.post("/upload", upload.single("upload_file"), (req, res) => {
|
|||||||
if (req.file) {
|
if (req.file) {
|
||||||
const originalname = req.file.originalname;
|
const originalname = req.file.originalname;
|
||||||
const dstPath = pathm.join(target_path, originalname);
|
const dstPath = pathm.join(target_path, originalname);
|
||||||
fs.rename(req.file.path, dstPath, (err) => {
|
fs.move(req.file.path, dstPath, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
res.status(500).send("上传虽然成功,但是处理文件出错: " + err);
|
res.status(500).send("上传虽然成功,但是处理文件出错: " + err);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user