- versione 1.2.50
This commit is contained in:
@@ -6124,7 +6124,7 @@ module.exports = {
|
||||
}
|
||||
return filename;
|
||||
},
|
||||
|
||||
|
||||
isDateValid(mydate) {
|
||||
try {
|
||||
return (
|
||||
@@ -6135,6 +6135,22 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
async getSizeFile(filename) {
|
||||
try {
|
||||
if (await this.isFileExistsAsync(filename)) {
|
||||
const stats = fs.statSync ? fs.statSync(filename) : null;
|
||||
const fileSizeInBytes = stats.size;
|
||||
const fileSizeInMB = fileSizeInBytes / (1024 * 1024);
|
||||
return fileSizeInMB.toFixed(2); // Returns size in MB with 2 decimal places
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Error getting file size:', e);
|
||||
return '0.00';
|
||||
}
|
||||
},
|
||||
|
||||
aggiungiSuffissoAlNomeFile(filePath, suffisso) {
|
||||
const dir = path.dirname(filePath);
|
||||
const estensione = path.extname(filePath);
|
||||
|
||||
Reference in New Issue
Block a user