Answers for "upload video in laravel"

PHP
0

how uplpoad video in laravel

<?php
namespace App\Http\Controllers;

use Illuminate\Support\Facades\Request;


class UploadController extends Controller
{

    public function upload(Request $request)
    {

        if(Request::hasFile('file')){

            echo 'Uploaded';
            $file = Request::file('file');
            $file->move('uploads', $file->getClientOriginalName());
            echo '$file' . $file->getClientOriginalName() . '"/>';
        }

    }
}
Posted by: Guest on April-26-2021
0

upload video in laravel

use Illuminate\Support\Facades\Request;


class UploadController extends Controller
{

    public function upload(Request $request)
    {

        if(Request::hasFile('file')){

            $file = Request::file('file');
            $filename = $file->getClientOriginalName();
            $path = public_path().'/uploads/';
            return $file->move($path, $filename);
        }

    }
}
Posted by: Guest on March-11-2021

Code answers related to "upload video in laravel"

Browse Popular Code Answers by Language