Open nog31 opened 7 years ago
Hello,
I wanted to know if there is a way to create media from an URL given in a controller?
I tried :
$media = new Media; $media->setFile('http://url_of_media/picture.jpg');
AND
$media->setFile(file_get_contents('http://url_of_media/picture.jpg'));
But it just don't work :/
Thank you for your support!
The setFile don't work with url. Try to get the media in tmp directory with curl, and after use the local path of media.
Hello,
I wanted to know if there is a way to create media from an URL given in a controller?
I tried :
$media = new Media; $media->setFile('http://url_of_media/picture.jpg');
AND
$media->setFile(file_get_contents('http://url_of_media/picture.jpg'));
But it just don't work :/
Thank you for your support!