From ab45b3072c1c69af8555cbd45e4054904a06bb95 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 18 Jul 2013 23:25:53 +0200 Subject: [PATCH] Adds workaround to use direct POST-request downloads. --- src/_h5ai/client/js/inc/ext/download.js | 48 ++++++----------------- src/_h5ai/server/php/inc/Api.php | 51 ------------------------- src/_h5ai/server/php/inc/Archive.php | 29 -------------- 3 files changed, 12 insertions(+), 116 deletions(-) diff --git a/src/_h5ai/client/js/inc/ext/download.js b/src/_h5ai/client/js/inc/ext/download.js index 4a287f8e..dfc9b42a 100644 --- a/src/_h5ai/client/js/inc/ext/download.js +++ b/src/_h5ai/client/js/inc/ext/download.js @@ -27,34 +27,6 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co }, 1000); }, - handleResponse = function (json) { - - $download.removeClass('current'); - $img.attr('src', resource.image('download')); - - if (json && json.code === 0) { - setTimeout(function () { // wait here so the img above can be updated in time - - window.location = '?action=getArchive&id=' + json.id + '&as=' + (settings.packageName || location.getItem().label) + '.' + settings.format; - }, 200); - } else { - failed(); - } - }, - - requestArchive = function (hrefsStr) { - - $download.addClass('current'); - $img.attr('src', resource.image('loading.gif', true)); - - server.request({ - action: 'createArchive', - type: settings.type, - format: settings.format, - hrefs: hrefsStr - }, handleResponse); - }, - onSelection = function (items) { selectedHrefsStr = ''; @@ -72,15 +44,19 @@ modulejs.define('ext/download', ['_', '$', 'core/settings', 'core/resource', 'co onClick = function (event) { var type = settings.type, - extension = type === 'shell-zip' ? 'zip' : 'tar', - query = '?action=passArchive' + - '&as=' + encodeURIComponent((settings.packageName || location.getItem().label) + '.' + extension) + - '&type=' + type + - '&hrefs=' + encodeURIComponent(selectedHrefsStr), - $iframe = $('