Answer the question
In order to leave comments, you need to log in
Transferring files from website to cdn storage?
Good afternoon
, there is a need to transfer the user's uploaded files to the file storage and return a link to view this file or files, but I do not quite understand how to do this, can anyone come across a similar issue, share information on how best to implement it?
to cdn access by login password and address (FTP/SFTP)/
Thanks in advance for any information
Answer the question
In order to leave comments, you need to log in
Let's say uploads is the root folder on ftp. Then you can do this:
$file = $request->file('file'); // Файл из формы
$url = 'http://adress-ftp.com/uploads/' . $file->getClientOriginalName(); // Cсылка по которой будет доступен загруженный файл
Storage::disk('ftp')->put('uploads/' . $file->getClientOriginalName(), $file);
use Illuminate\Support\Facades\Storage;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question