Answer the question
In order to leave comments, you need to log in
Error while uploading files to cdn storage via FTP?
Good afternoon
when uploading files to ftp using the
controller method
public function upload(Request $request)
{
foreach ($request->file() as $file) {
foreach ($file as $f) {
$f->move(Storage::disk('ftp')->put('home/img/' .$f->getClientOriginalName()));
// Storage::disk('ftp')->put('home/img/' . $->getClientOriginalName(), $f);
}
}
return "Успех";
}
}
<form method="post" action="{{ route('upload_file') }}" enctype="multipart/form-data">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<input type="file" multiple name="file[]">
<button type="submit">Загрузить</button>
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question