Tom. Posted June 12, 2018 Posted June 12, 2018 Hey, So we have this system that pulls in from an API and downloads images. It's been working great however, the API has been spotty recently. It's been giving us images that are inaccessible or do not exist. This is the code we have to add images: if ($type == "0") { $p->images->add($url); } Pretty simple. Is there a way to check if the image is accessible before trying to download?
Jonathan Lahijani Posted June 12, 2018 Posted June 12, 2018 WireHttp might be one solution. https://processwire.com/api/ref/wire-http/ 2
Tom. Posted June 12, 2018 Author Posted June 12, 2018 25 minutes ago, Jonathan Lahijani said: WireHttp might be one solution. https://processwire.com/api/ref/wire-http/ That will do the trick, Thanks @Jonathan Lahijani I knew I could just use curl but if there is anything I've learnt it's ProcessWire always has an easier solution ? 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now