diff --git a/angular/src/app/datacart/bundleplan/bundleplan.component.ts b/angular/src/app/datacart/bundleplan/bundleplan.component.ts index 6dfabb7bb..96bd45352 100644 --- a/angular/src/app/datacart/bundleplan/bundleplan.component.ts +++ b/angular/src/app/datacart/bundleplan/bundleplan.component.ts @@ -285,12 +285,13 @@ export class BundleplanComponent implements OnInit { this.downloadService.download(zip, this.zipData, this.dataCart); } - private generateZipFileName(base : string = null) : string { - const MIN : number = 0; - const MAX : number = 100000; - let suffix = Math.floor(Math.random() * (MAX - MIN + 1)) + MIN; - return base + suffix; - } + private generateZipFileName(base: string = "NIST-Data"): string { + // current timestamp + const now = new Date(); + const timestamp = now.toISOString().slice(0, 16).replace(":", "-"); + + return `${base}-${timestamp}`; + } /** * download the selected files from this cart. @@ -306,7 +307,7 @@ export class BundleplanComponent implements OnInit { // Sending data to _bundle_plan and get back the plan this.downloadFiles = this.dataCart.getSelectedFiles(); - let bundleBaseName = this.generateZipFileName(this.dataCart.getName()); + let bundleBaseName = this.generateZipFileName("NIST-Data"); this.bundlePlanRef = this.downloadService.getBundlePlan(bundleBaseName, this.downloadFiles).subscribe( blob => { diff --git a/angular/src/app/shared/download-service/download-service.service.ts b/angular/src/app/shared/download-service/download-service.service.ts index 6b257a860..1f22956a5 100644 --- a/angular/src/app/shared/download-service/download-service.service.ts +++ b/angular/src/app/shared/download-service/download-service.service.ts @@ -159,6 +159,10 @@ export class DownloadService { // create the request body let reqfiles = []; for (let item of files) { + let resId = item.resId; + let filePath = item.filePath; + console.log(`resId: ${resId}, filePath: ${filePath}`); + reqfiles.push({ "filePath": item.resId + '/' + item.filePath, "downloadUrl": item.downloadURL