How to use ftp with laravel 5? -


the file storage section of laravel docs shows example ftp config, doesn't explain how use it. can give example of how make laravel use ftp connection in addition disk connection?

https://laravel.com/docs/5.4/filesystem

the beauty of laravel filesystem (and lot of laravel) commands "driver agnostic". means define "driver" (in case ftp) use, , configure it, , of comands same.

so upload file ftp filesystem, like:

storage::disk('ftp')->put('avatars/1', $filecontents);

the paramenter ::disk method above defines "disk" laravel should use, if had s3 set up, instead:

storage::disk('s3')->put('avatars/1', $filecontents);


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -