This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Timur Shakirov
I use
$url = "here is the link";
$file = new \System\Models\File();
if($file->fromUrl($url)) // error here
{
$post->featured_images()->save($file);
}
Error:
In File.php line 175:
Error getting file "here is the link", error code: 400
How can I handle the error to keep the script running? System\Models\File
Last updated
Timur Shakirov
mjauvin said:
try { $file->fromUrl($url); } catch (\Exception $ex) { //handle exception here }
OK, Thanks! Before your answer, I already tried this construction, but nothing worked. The point is in the "\" before the Exception.
1-4 of 4