【发布时间】:2017-05-23 18:18:27
【问题描述】:
我正在尝试使用 NodeJS/ExpressJS 将上传的文件从 /tmp 移动到 home 目录:
fs.rename('/tmp/xxxxx', '/home/user/xxxxx', function(err){
if (err) res.json(err);
console.log('done renaming');
});
但它不起作用,也没有遇到错误。但是当新路径也在/tmp 中时,它会起作用。
我使用的是 Ubuntu,home 在不同的分区。有什么办法吗?
谢谢
【问题讨论】:
标签: node.js file ubuntu file-upload express