I am been facing an issue while downloading or fetching images from Facebook to my app. Last 6 months it was working perfectly, now its started to make problem. I tried using Curl and even file_get_contents, Sometimes it is able to download and works smoothly and sometimes it doesnt work at all and after sometime it works again. Throwing error 403 Forbidden in file_get_contents and in Curl gives me corrupted image.
I even tried with CURL putting User-agent as seen some queries on Stackoverflow., but still same problem.

Few days i was facing authentication problem as Curl Exception 7, couldnt connect to host was firing up so in hosts/etc i made changes like: 69.171.224.34 graph.facebook.com then it started working again. Now i even added Facebook IP's range in IPtables and custom firewall. Still the same problem.
Should i remove the entry from host file? or something else? Please suggest me something to get rid of it. Thanks.

During download so many this can happen ..... why not use a message queue which out retry and download images in background
–
BabaOct 16 '12 at 14:25

@Baba but this happen not just for one or 10 images. it happens continuously for hours and result in corrupt images in Curl and in file_get_contents it shows Error 403 Forbidden
–
WhiteHorseOct 16 '12 at 14:29