Laravel does not upload video file and store tmp filename in database

572 Views Asked by At

I'm working with Laravel 5.8 and I wanted to upload a video file.

So in the Controller, I added this code which does the uploading:

if ($request->file('prd_video')) {
    $video = Request::file('prd_video');
    $videoname = $video->getClientOriginalName();
    $path = public_path().'/upload/video/products/';
    $request->file('prd_video')->move($path, $videoname);
            
    $findpro = Product::find($stored->prd_id);
    $findpro->prd_video = $videoname;
    $findpro->save();
}

Now when I test this, after minutes of loading, the file does not uploaded and store a name like /tmp/phpsMPjG1 as filename in the database.

Also there is no error appearing and the process of insertion seems to be completed successfully.

So what's going wrong here? How can I solve this issue?

1

There are 1 best solutions below

0
AudioBubble On

edit: previous answer about version of aws-sdk-php was not right.