fix: Upload Foto

This commit is contained in:
paoloar77
2022-02-16 09:40:16 +01:00
parent a3502c1d9d
commit bae30504f7
9 changed files with 147 additions and 63 deletions

View File

@@ -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);
}