Can't upload Facebook AdImage

318 Views Asked by At

Im trying to upload an image using the Marketing API

$image = new AdImage(null, 'act_<AD_ACCOUNT_ID>');
$image->{AdImageFields::FILENAME} = 'http://www.newspringcapital.com/uploads/portfolio/homepage/Innovid%20Home.png';

$image->create();
echo 'Image Hash: '.$image->{AdImageFields::HASH}.PHP_EOL;

but I'm getting the following error:

"couldn't open file "http://www.newspringcapital.com/uploads/portfolio/homepage/Innovid%20Home.png"

1

There are 1 best solutions below

0
On BEST ANSWER

AdImageFields::FILENAME uses a path not a URL

Consider uploading it to your local folder than using it