From e9ad52e1f07e470b1ba086a21b554c0e7904b61e Mon Sep 17 00:00:00 2001 From: imnotkind Date: Tue, 15 Aug 2017 14:09:19 +0900 Subject: [PATCH 1/2] Update save-as.service.js if we use URI Data scheme, we could only contain 2MB data in chrome. using the createObjectURL and File API's blob feature, i managed to upgrade the capacity to about 900MB. --- zeppelin-web/src/app/notebook/save-as/save-as.service.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zeppelin-web/src/app/notebook/save-as/save-as.service.js b/zeppelin-web/src/app/notebook/save-as/save-as.service.js index c71c0f7f72a..1b3bfb286eb 100644 --- a/zeppelin-web/src/app/notebook/save-as/save-as.service.js +++ b/zeppelin-web/src/app/notebook/save-as/save-as.service.js @@ -38,7 +38,10 @@ function SaveAsService (browserDetectService) { } angular.element('body > iframe#SaveAsId').remove() } else { - content = 'data:image/svg;charset=utf-8,' + BOM + encodeURIComponent(content) + let binaryData = [] + binaryData.push(content) + content = window.URL.createObjectURL(new Blob(binaryData)) + angular.element('body').append('') let saveAsElement = angular.element('body > a#SaveAsId') saveAsElement.attr('href', content) From 075c4ece92a8b6d75e3e46f1bc00bc9354cd9b51 Mon Sep 17 00:00:00 2001 From: imnotkind Date: Thu, 17 Aug 2017 18:56:31 +0900 Subject: [PATCH 2/2] Update save-as.service.js --- zeppelin-web/src/app/notebook/save-as/save-as.service.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zeppelin-web/src/app/notebook/save-as/save-as.service.js b/zeppelin-web/src/app/notebook/save-as/save-as.service.js index 1b3bfb286eb..ff463c85289 100644 --- a/zeppelin-web/src/app/notebook/save-as/save-as.service.js +++ b/zeppelin-web/src/app/notebook/save-as/save-as.service.js @@ -39,6 +39,7 @@ function SaveAsService (browserDetectService) { angular.element('body > iframe#SaveAsId').remove() } else { let binaryData = [] + binaryData.push(BOM) binaryData.push(content) content = window.URL.createObjectURL(new Blob(binaryData)) @@ -49,6 +50,7 @@ function SaveAsService (browserDetectService) { saveAsElement.attr('target', '_blank') saveAsElement[0].click() saveAsElement.remove() + window.URL.revokeObjectURL(content) } } }