laravel-chunk-upload icon indicating copy to clipboard operation
laravel-chunk-upload copied to clipboard

How to upload 500 MB file on the server using SFTP driver (file system)

Open PrajapatiDhara1510 opened this issue 11 months ago • 1 comments

I want to upload a file with around size of 500MB on the server using SFTP driver. It should be in chunk of 50MB because due to cloudflare limit I cannot upload high chunk size. I to achieve it?

I have configured SFTP server details on filesystems.php file

'sftp_medverse' => [
            'driver' => 'sftp',
            'port' => 990,
            'host' => env('SFTP_HOST'),
            'username' => env('SFTP_USERNAME'),
            'privateKey' => '',
            'password' => env('SFTP_PASSWORD'),
            'root' => '/var/www/html/files',
            'timeout' => 30,
        ],

I was doing something like below before uploading in chunk size. But I want to upload file in chunk size.

Storage::disk('sftp_medverse')->put($fileNameToStore, fopen($file, 'r+w+'));

Please help me? Can I achieve it using this package?

PrajapatiDhara1510 avatar Nov 05 '24 12:11 PrajapatiDhara1510