fix: Upload Foto
This commit is contained in:
@@ -2139,6 +2139,14 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
copy(oldPath, newPath, callback) {
|
||||
|
||||
fs.copyFile(oldPath, newPath, (err) => {
|
||||
if (err) throw err;
|
||||
// console.log('source.txt was copied to destination.txt');
|
||||
});
|
||||
},
|
||||
|
||||
extractFileName: function(filename) {
|
||||
return path.basename(filename);
|
||||
},
|
||||
@@ -2155,6 +2163,7 @@ module.exports = {
|
||||
let img_small = path.dirname(mypath) + '/' +
|
||||
server_constants.PREFIX_IMG_SMALL + path.basename(mypath);
|
||||
fs.unlink(img_small, () => {});
|
||||
console.log('delete file', mypath)
|
||||
} catch (e) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user