joedawson / youtube

Upload a video to a single YouTube channel with Laravel 5.
MIT License
175 stars 105 forks source link

filesize(): stat failed error #136

Closed Naveedali1234 closed 1 year ago

Naveedali1234 commented 2 years ago

Hi :)

thank you for this easy package. i have an issue with the video upload. i first upload the video to my project folder using below code:

`if ($this->uploaded_video) {

        $filename = $this->uploaded_video->getFilename();
        $this->uploaded_video->storeAs('public/instruction-videos', $filename);
    }`

it's uploaded successfully to project folder and i can access the video in browser by getting the url from below code

$fullpath = asset('storage/instruction-videos/'.$filename);

i can see the video in browser by accessing the path which i get from the above code snippet.

i upload the video to youtube using below code

$video = Youtube::upload($fullpath, [ 'title' => 'title', 'description' => 'description' ],'unlisted');

but i get the below error when i upload it to youtube Screenshot from 2022-08-17 18-12-44

sharipovmarat commented 2 years ago

$fullpath should be absolute path to file on server, not public url.

$fullpath = Storage::disk('local')->path($filename)