Skip to content
Advertisement

filesize(): stat failed when publishing video using twitter api | PHP

Hello I am trying to upload a video using twitter API TwitterAPIExchange.php

i have worked on the following

JavaScript

but getting

filesize(): stat failed for http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WhatCarCanYouGetForAGrand.mp4 in E:wampwwwpostblog_codetwitter_tweet_phptweet.php on line 26 I also tried in this way

what am i doing wrong here?

JavaScript

but getting Allowed memory size of 134217728 bytes exhausted (tried to allocate 65011744 bytes) error

could anyone suggest me how can i get desired

Advertisement

Answer

You cannot stat a file via the http wrapper.

Copy the file to your server’s filesystem then read the size from the file.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement