A
A
Alex Kyznetsov2017-07-06 09:19:45
PHP
Alex Kyznetsov, 2017-07-06 09:19:45

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 "Успех";
        }
    }

vyuha
<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>

gives an error Use of undefined constant FTP_BINARY - assumed 'FTP_BINARY'
googled but did not find anything sensible (uploads to a local folder without problems)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vyrkmod, 2017-07-06
@360157

Most likely the required extension is not supplied or not included in php.ini

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question