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 127.0.0.1. 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

    kopano-backup 8.7.1.0-0+1.1
    kopano-client 8.7.1.0-0+1.1
    kopano-common 8.7.1.0-0+1.1
    kopano-contacts 8.7.1.0-0+1.1
    kopano-dagent 8.7.1.0-0+1.1
    kopano-gateway 8.7.1.0-0+1.1
    kopano-ical 8.7.1.0-0+1.1
    kopano-lang 8.7.1.0-0+1.1
    kopano-monitor 8.7.1.0-0+1.1
    kopano-python-utils 8.7.1.0-0+1.1
    kopano-search 8.7.1.0-0+1.1
    kopano-server 8.7.1.0-0+1.1
    kopano-server-packages 8.7.1.0-0+1.1
    kopano-spooler 8.7.1.0-0+1.1
    kopano-utils 8.7.1.0-0+1.1
    kopano-webapp 3.5.6.2298+94.1
    libgsoap-kopano-2.8.83 2.8.83-0+1.2
    libvmime-kopano1 0.9.2.50+12.4
    python3-kopano 8.7.1.0-0+1.1
    python3-kopano-search 8.7.1.0-0+1.1
    python3-kopano-utils 8.7.1.0-0+1.1

    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: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.214642 2019] [:error] [pid 11731] [client IP] [DBG][AccountStore] Found 1 accounts., referer: https://server.kopano.com/webapp/
    [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: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.214927 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Registering backend: Webdav, referer: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.215291 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Registering backend: FTP, referer: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.215471 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Registering external backend: SMB, referer: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.215578 2019] [:error] [pid 11731] [client IP] [DBG][BackendStore] Registering external backend: Owncloud, referer: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.215797 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: Base path set to /, referer: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.215819 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: SSL extension was set to , referer: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.215830 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: Passive mode: , referer: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.215841 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: false, referer: https://server.kopano.com/webapp/
    [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: https://server.kopano.com/webapp/
    [Sat May 18 16:33:01.244247 2019] [:error] [pid 11731] [client IP] [BACKEND_FTP]: [LS] done in 0.0018939971923828 seconds, referer: https://server.kopano.com/webapp/

    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: 8.7.81.32
    Webapp: 3.5.7.2298
    Files: 2.1.6.320
    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 https://jira.kopano.io/browse/KFP-397
    A developer will look at the fix.

    Thanks for the report.


Log in to reply