facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
833 stars 516 forks source link

fix without video file upload #509

Closed jeskiZhao closed 5 years ago

facebook-github-bot commented 5 years ago

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

facebook-github-bot commented 5 years ago

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

jeskiZhao commented 5 years ago

When I upload video using this sdk like this:

$api = Api::init($app_id, $app_secret, $access_token); $fields = []; $params = [ 'source' => $videoLocalPath, ]; $video = (new AdAccount($id))->createAdVideo($fields, $params);

It reports : There was a problem uploading your video file. Please try again., Your video upload timed out before it could be completed. This is probably because of a slow network connection or because the video you're trying to upload is too large.

I found that the video file is not uploaded when using this sdk , so I committed this pr.

jeskiZhao commented 5 years ago

@jingping2015

jingping2015 commented 5 years ago

Hi, Looks like this is a API error. You can add $api->setLogger(new CurlLogger()); in your code to get curl request and try again. If you still get the same error, open a bug here https://developers.facebook.com/support/bugs/