Skip to content

File downloading doesn't return data #10

@vekakela

Description

@vekakela

I'm using sftp connection to download files. Ftp plugin uses Phpseclibs get function in SFTP.php. Function has two parameters: $remote_file and $local_file. If $local_file parameter is left empty (or is boolean false) SFTP.php function returns the data instead of simply downloading it.

I'd like to be able to use this functionality, but read function in ftp_source.php has a check which doesn't allow that:
if (empty($data['remote']) || empty($data['local'])) {
return false;
}

I had to disable this check and I also modified the function so that it returns the results from SFTP.php's get function, instead of simply returning true or false. This way I can get the data all the way to my controller and I can display files (like images), instead of just downloading them.

I'll try to submit patches later when I have time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions