Files with FTP: Download 0 bytes

  • I’m pretty new to Kopano so please excuse any dumb question…

    In Webapp Files i added an FTP to It’s possible to upload files, to make directorys, to change filenames, to delete and mail them: Working like a charm. But when i start to download a file it’s always empty (0 bytes) regardless if *.jpg, *.png, *.exe

    It’s a Debian 9 with php7.0 working on a stand alone installation, all updates done.

    Does anyone had this ever before or do i miss anything?

  • Kopano

    @SwapBY I’m unaware of such an issue,
    but perhaps you can share some more information about your setup (Kopano Core, WebApp, Files plugin package versions)
    Also, your web server error.log or the browsers console might have some pointers

  • @marty Many thanks for our reply!

    dpkg -l | grep kopano

    libgsoap-kopano-2.8.83 2.8.83-0+1.2

    Here the upload:
    Sat May 18 16:24:49 2019 0 localhost.localdomain 78572 /home/john/test.jpg b _ i r john ftp 0 * c

    Heres the Download: 0 Byte
    [Sat May 18 16:33:00.108664 2019] [:error] [pid 11728] [client IP] [BACKEND_FTP]: [LS] done in 0.001884937286377 seconds, referer:
    [Sat May 18 16:33:01.214642 2019] [:error] [pid 11731] [client IP] [DBG][AccountStore] Found 1 accounts., referer:
    [Sat May 18 16:33:01.214734 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Searching for external backends in /usr/share/kopano-webapp/plugins/, referer:
    [Sat May 18 16:33:01.214927 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Registering backend: Webdav, referer:
    [Sat May 18 16:33:01.215291 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Registering backend: FTP, referer:
    [Sat May 18 16:33:01.215471 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Registering external backend: SMB, referer:
    [Sat May 18 16:33:01.215578 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Registering external backend: Owncloud, referer:
    [Sat May 18 16:33:01.215797 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: Base path set to /, referer:
    [Sat May 18 16:33:01.215819 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: SSL extension was set to , referer:
    [Sat May 18 16:33:01.215830 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: Passive mode: , referer:
    [Sat May 18 16:33:01.215841 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: false, referer:
    [Sat May 18 16:33:01.243892 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: [LS] /test-new.jpg: -rw-r–r-- 1 john john 78572 May 18 14:26 /test-new.jpg, referer:
    [Sat May 18 16:33:01.244247 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: [LS] done in 0.0018939971923828 seconds, referer:

    I’ve anonymized the Server-IP and ServerName, but thats the log.

    My Settings in Files are:

    • Account-Type: FTP
    • Path: /
    • No SSL on FTP
    • No passive mode on ftp
    • Don’t use Kopano Credentials

    FTP is running with ProFtpd, User are restrict to home directory and System-User

    So i think,i’m missing somethind really trivial … Do you need more information?

  • I have the same problem.

    System: Debian 9
    Kopano Core:
    PHP: 7.0.33

    But I think that I have found the error.
    Patch the /usr/share/kopano-webapp/plugins/files/php/Files/Backend/FTP/class.backend.php with the following patch.

    --- class.backend.php	2019-04-29 11:58:41.000000000 +0200
    +++ class.backend.php	2019-05-19 16:28:33.106572236 +0200
    @@ -759,15 +759,15 @@
     	public function gpi($path)
     		$list = $this->ls($path, false);
     		// be sure it is an array
     		if (is_array($list)) {
    -			return $list[0];
    +			return reset($list);
     		$this->log('gpi: wrong response from ls');
     		throw new BackendException($this->parseErrorCodeToMessage(self::FTP_ERR_INTERNAL), self::FTP_ERR_INTERNAL);

  • This post is deleted!

  • @nanohcv Thank you very much, that has done the trick!

    Just replace the line <return $list[0];> with <return reset($list);> like described by @nanohcv before and even the preview is working!

    Again thank you very much. Is there any documentation bout that or did you find out by yourself?

  • I found out by myself.

    $this->ls($path, false); returns an associative array and associative arrays can’t be access by index.

  • @nanohcv said in Files with FTP: Download 0 bytes:

    I found out by myself.

    $this->ls($path, false); returns an associative array and associative arrays can’t be access by index.

    Chapeau! And thanks again

  • Kopano

    @SwapBY @nanohcv
    I’ve created
    A developer will look at the fix.

    Thanks for the report.

Log in to reply