Browse Source

HPCC-13007 LandingZone Download Name Wrong

Downloading files from the landing zone has folder paths prepended to the
download name.

Fixes HPCC-13007

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 10 years ago
parent
commit
776e8b67b5
2 changed files with 4 additions and 1 deletions
  1. 3 0
      esp/src/eclwatch/FileSpray.js
  2. 1 1
      esp/src/eclwatch/LZBrowseWidget.js

+ 3 - 0
esp/src/eclwatch/FileSpray.js

@@ -91,10 +91,13 @@ define([
         preProcessRow: function (row) {
             var partialPath = this.parent.partialPath + row.name + (row.isDir ? "/" : "");
             var fullPath = this.parent.fullPath + row.name + (row.isDir ? "/" : "");
+            var fullFolderPathParts = fullPath.split("/");
+            fullFolderPathParts.pop();
             lang.mixin(row, {
                 calculatedID: this.parent.DropZone.NetAddress + fullPath,
                 partialPath: partialPath,
                 fullPath: fullPath,
+                fullFolderPath: fullFolderPathParts.join("/"),
                 DropZone: this.parent.DropZone,
                 displayName: row.name,
                 type: row.isDir ? "folder" : "file"

+ 1 - 1
esp/src/eclwatch/LZBrowseWidget.js

@@ -244,7 +244,7 @@ define([
             arrayUtil.forEach(this.landingZonesGrid.getSelected(), function (item, idx) {
                 var downloadIframeName = "downloadIframe_" + item.calculatedID;
                 var frame = iframe.create(downloadIframeName);
-                var url = ESPRequest.getBaseURL("FileSpray") + "/DownloadFile?Name=" + encodeURIComponent(item.partialPath) + "&NetAddress=" + item.DropZone.NetAddress + "&Path=" + encodeURIComponent(item.DropZone.Path) + "&OS=" + item.DropZone.OS;
+                var url = ESPRequest.getBaseURL("FileSpray") + "/DownloadFile?Name=" + encodeURIComponent(item.name) + "&NetAddress=" + item.DropZone.NetAddress + "&Path=" + encodeURIComponent(item.fullFolderPath) + "&OS=" + item.DropZone.OS;
                 iframe.setSrc(frame, url, true);
             });
         },