I'm writing an artisan command in Laravel 5.5. There are files in an AWS EC2 instance and all within the same folder, my command needs to download all those files into a local storage/folder. I went through the Laravel's documentation but couldn't find helpful info. I have added a disk into my filesystem config file for my local storage/folder access, as well as a disk for my AWS SFTP server. Previously I've been doing this using the phpseclib but would like to move on using Laravel in Laravel way. I've tried the following:
Storage::disk('aws')->get('path/filename.ext');
which throws the following exceptions:
In FilesystemAdapter.php line 109:
path/filename.ext
and
In Filesystem.php line 388:
File not found at path: path/filename.ext
but I can see the file is there and my program can download it, and actually all of them using phpseclib.
and also tried the following which returns an empty array:
Storage::disk('aws')->files('folder-name');
and aws is the disk I've defined in the filesystem config file as follows:
'aws' => [
'driver' = 'ftp',
'host' = '12.123.123.12',
'username' = 'myusername',
'password' = 'mypassword'
]
Thank you!