Răsfoiți Sursa

zipfile name from app title and timestamp

mizozobu 6 ani în urmă
părinte
comite
1a4f8309d3
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 3 2
      src/server/service/export.js

+ 3 - 2
src/server/service/export.js

@@ -12,7 +12,6 @@ class ExportService {
     this.appService = crowi.appService;
     this.appService = crowi.appService;
     this.growiBridgeService = crowi.growiBridgeService;
     this.growiBridgeService = crowi.growiBridgeService;
     this.baseDir = path.join(crowi.tmpDir, 'downloads');
     this.baseDir = path.join(crowi.tmpDir, 'downloads');
-    this.zipFileName = 'GROWI.zip';
     this.metaFileName = 'meta.json';
     this.metaFileName = 'meta.json';
     this.encoding = 'utf-8';
     this.encoding = 'utf-8';
     this.per = 100;
     this.per = 100;
@@ -185,7 +184,9 @@ class ExportService {
    */
    */
   async zipFiles(_configs) {
   async zipFiles(_configs) {
     const configs = toArrayIfNot(_configs);
     const configs = toArrayIfNot(_configs);
-    const zipFile = path.join(this.baseDir, this.zipFileName);
+    const appTitle = this.appService.getAppTitle();
+    const timeStamp = (new Date()).getTime();
+    const zipFile = path.join(this.baseDir, `${appTitle}-${timeStamp}.zip`);
     const archive = archiver('zip', {
     const archive = archiver('zip', {
       zlib: { level: this.zlibLevel },
       zlib: { level: this.zlibLevel },
     });
     });