-1

php file :

 $data['listing_cover'] = md5(rand(10000000, 20000000)).'.jpg';
    move_uploaded_file($_FILES['listing_cover']['tmp_name'], 'uploads/listing_cover_photo/'.$data['listing_cover']);

html file :

  <head>
    <meta property="og:image" content="<?php echo base_url('uploads/listing_cover_photo/'.$data['listing_cover']); ?>" />
  </head>

Error on facebook :

Provided og:image URL, https://eforie.org/uploads/listing_cover_photo/ could not be processed as an image because it has an invalid content type.

1 Answers1

0

Make sure it is a valid image URL - when i enter the URL in the browser, i get a 403/forbidden error. I must be public too, available to everyone (and Facebook).

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • This is the problem, when someone upload the cover image, the script rename the photo with $data['listing_cover'] = md5(rand(10000000, 20000000)).'.jpg'; .... but the meta property don't take the full url – Nicu Cojocaru Aug 02 '21 at 06:44