Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File downloading doesn't return data #10

Open
vekakela opened this issue Sep 13, 2011 · 1 comment
Open

File downloading doesn't return data #10

vekakela opened this issue Sep 13, 2011 · 1 comment
Milestone

Comments

@vekakela
Copy link

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.

@dereuromark
Copy link
Contributor

Maybe it should check on NULL here instead?

@dereuromark dereuromark added this to the 2.x milestone Jan 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants