Well, you should turn off passive mode in your server. (ssh your server and type passive)
then be sure that the dir you are uploading to is exists
Apr 22, 2021
4
Level 3
Multiple FTP errors on upload
I'm trying to upload a file to a remote FTP server using the following configuration:
'ftp' => [
'driver' => 'ftp',
'host' => env('FTP_HOSTNAME'),
'username' => env('FTP_USERNAME'),
'password' => env('PASSWORD'),
'timeout' => 30,
],
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use File;
use Illuminate\Support\Facades\Storage;
class FtpTestController extends Controller
{
public function saveFileToFTP()
{
$localFile = File::get(storage_path('app/csv/test_1.csv'));
Storage::disk('ftp')->put('test_4-23.csv', $localFile);
}
}
It results in this error... local.ERROR: ftp_fput(): Type set to I.
I did some digging and it looks like a few issues were resolved setting the connection to passive. But when doing so I get this error...
Could not set passive mode for connection: example.com::21 at /var/www/html/example.com/vendor/league/flysystem/src/Adapter/Ftp.php:183)
Please or to participate in this conversation.