bogdy's avatar
Level 10

Unable to locate file to upload.

I try to upload a video to vimeo with vimeo api with https://github.com/vimeo/laravel. I get the error Unable to locate file to upload.

 public function store(Request $request, VimeoManager $vimeo)
    {
       $filename = $request->file('videofile')->getClientOriginalName();
        $path = $request->file('videofile')->storeAs(
            'public/videos', $filename
        );
//dd($path);
         $uri = $vimeo->upload($path, [
            'name' => $request->title,
        ]);
    }

thanks for the advice

0 likes
3 replies
tykus's avatar

The path you are giving is probably incorrect; I would expect it should be an absolute filesystem path. If you store to public_path('videos') you will get the absolute path instead.

Do you actually need to store the video file to your server (and in the public directory) at all? You can upload directly to Vimeo using the POST /me/videos endpoint.

bogdy's avatar
Level 10

@tykus now i get a error file_put_contents(): Write of 211 bytes failed with errno=13 Permission denied

bogdy's avatar
Level 10

@tykus I try only upload but dont work

   public function store(Request $request, VimeoManager $vimeo)
    {
        $request->validate([
           'videofile' => 'required'
        ]);

         $vimeo->upload($request->videofile,[
           'name' =>  'test'
        ]);
    }

file_put_contents(): Write of 211 bytes failed with errno=13 Permission denied in vimeo I get a file 0 bits witn transconding always 0%

Please or to participate in this conversation.