pydio-core icon indicating copy to clipboard operation
pydio-core copied to clipboard

unable to download multiple files

Open Trapulo opened this issue 7 years ago • 3 comments

Hi, when I try to download multiple files, the Web GUI select them, shows the download button, but nothing happen. the browser's debug console reports a remote call with this response:

Malformed URL: D://MYLOGIN@/Websites/.............

where MYLOGIN is my users'name, and the path is the right path to the local file (of course, this is running on Windows).

Any idea?

thanks

Trapulo avatar Sep 19 '18 15:09 Trapulo

I am encountering the same bug on a new Pydio 8.2.1 install from archive on Windows Server 2012 R2 with IIS 8.5, PHP 7.2.9, and MySQL 8.0. Here is the error message when trying to access a zip download link:

<?xml version="1.0" encoding="UTF-8"?>
<tree >
    <message type="ERROR">Malformed URL: C://user1@/inetpub/wwwroot/pydio/data/files/sintex/folder</message>
</tree>

Looks like the user name is somehow getting into the file path to zip. Other similar reports here: https://forum.pydio.com/t/downloading-multiple-files/1444 https://forum.pydio.com/t/cannot-download-more-than-one-file-at-same-time/1636

achern avatar Oct 22 '18 20:10 achern

I did some debugging and I've narrowed the problem down to this newly added code to check permissions: https://github.com/pydio/pydio-core/commit/245161f7dedf0f1d5f2371d5d4c51b22a1a83fb1#diff-69ba9488ca49cd1d0c1167134a83b8e5R2443

Removing the newly added code makes folder and zip downloading work again.

I'm not familiar enough with pydio internals to figure out what the problem is, but here's a step-by-step trace to help pinpoint the issue (testuser is downloading testfolder from testworkspace):

2444    $topUrl = $selection->currentBaseUrl();                             // $topUrl is 'pydio://testuser@64c49a60024cc3bf8d7e36b24eeb17de'
2445    $realPath = MetaStreamWrapper::getRealFSReference($topUrl);         // $realPath is 'C:\inetpub\wwwroot\pydio\data\testworkspace'
2446    $newNode = new AJXP_Node(str_replace($realPath, $topUrl, $search)); // $search is 'C:/inetpub/wwwroot/pydio/data/testworkspace/testfolder', constructor argument is 'C:/inetpub/wwwroot/pydio/data/testworkspace/testfolder'
2447    $newNode->setUserId($ctx->getUser()->getId());                      // Throws error 'Malformed URL: C://testuser@/inetpub/wwwroot/pydio/data/testworkspace/testfolder'

Seems like maybe the workspace ID isn't making it into the URL.

Edit: took a closer look at it and it seems like the code is supposed to replace the workspace's filesystem path with a pydio workspace URL, but one of the string replace parameters is using Windows path separators while the other is using Linux/Unix ones, causing the replace to fail.

achern avatar Oct 22 '18 22:10 achern

Hi @achern thanks for pointing out, we will have a look at that

cdujeu avatar Oct 23 '18 06:10 cdujeu