Fix downloading file from the drive

This commit is contained in:
yflory
2019-08-26 18:17:39 +02:00
parent a67f7d3edb
commit 3f6e64338a
4 changed files with 7 additions and 4 deletions

View File

@@ -55,7 +55,7 @@ define([
var hash = parsed.hash;
var name = fData.filename || fData.title;
var secret = Hash.getSecrets('file', hash, fData.password);
var src = Hash.getBlobPathFromHex(secret.channel);
var src = (ctx.fileHost || '') + Hash.getBlobPathFromHex(secret.channel);
var key = secret.keys && secret.keys.cryptKey;
Util.fetch(src, function (err, u8) {
if (cancelled) { return; }
@@ -266,10 +266,11 @@ define([
};
// Main function. Create the empty zip and fill it starting from drive.root
var create = function (data, getPad, cb, progress) {
var create = function (data, getPad, fileHost, cb, progress) {
if (!data || !data.uo || !data.uo.drive) { return void cb('EEMPTY'); }
var sem = Saferphore.create(5);
var ctx = {
fileHost: fileHost,
get: getPad,
data: data.uo.drive,
folder: data.folder || ctx.data.root,

View File

@@ -595,7 +595,9 @@ define([
});
};
var privateData = common.getMetadataMgr().getPrivateData();
var ctx = {
fileHost: privateData.fileHost,
get: common.getPad,
sframeChan: sframeChan,
};