saschaoost Posted February 25, 2013 Share Posted February 25, 2013 I got a script which retrieves the real url to someone's facebook profile picture. What I want to do is copy that picture to my own server. This worked flawlessly until four days ago. Now all I got is a connection time out. I haven't changed anything about my code in the last few days, so I really don't understand why it stopped working. It has got nothing to do with writing rights. I've also tried to configure ini settings, but without any luck (and should not be an issue since the code worked 4 days ago with the exact same image). The weird thing is that it does work with other random images from the web. Does anyone have an idea why it stopped working? the code I use is: copy("https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-ash3/s2048x2048/643928_10151459968053747_138997005_n.jpg", "images/test.jpg"); As you can see, the url just works when pasting it into the browser. I've contacted my hosting provider to find out if they changed something in firewall / server settings, but they had no idea what could be causing this error. And yes, that's me on the picture. Hope someone can help me, because it's really driving me insane! Best, Sascha Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/ Share on other sites More sharing options...
Jessica Posted February 25, 2013 Share Posted February 25, 2013 Sounds like Facebook blocked your script which violates their tos. Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414879 Share on other sites More sharing options...
saschaoost Posted February 25, 2013 Author Share Posted February 25, 2013 Oh really? didn't know it was violating their tos.. Thought it was a rather harmless and cool way to update an users profile picture. But thanks for your reply. Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414884 Share on other sites More sharing options...
Jessica Posted February 25, 2013 Share Posted February 25, 2013 Facebook has an API. If you want your users to login with Facebook credentials, you can then get their profile photo. A lot of sites do use Facebook for login. Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414885 Share on other sites More sharing options...
jazzman1 Posted February 25, 2013 Share Posted February 25, 2013 Copy woks to me. copy("https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-ash3/s2048x2048/643928_10151459968053747_138997005_n.jpg", "images/test.jpg"); Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414892 Share on other sites More sharing options...
saschaoost Posted February 25, 2013 Author Share Posted February 25, 2013 @Jessica: Yes that's where I use it for. After logging on to my site with facebook, I want to retrieve their latest profile picture on facebook and store it on my server (for cropping and displaying it to my needs), so users always have their latest profile picture on my site. I know I could just display the image instead of storing it, but for the cropping reasons, I'd rather copy it. Not sure how that violates with the TOS. @jazzman1: I know, a friend of mine also tried it and got it working, but somehow it doesn't work on my site anymore. So the blockage that Jessica mentioned sounds like the problem.. Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414895 Share on other sites More sharing options...
Jessica Posted February 25, 2013 Share Posted February 25, 2013 If you're using their API you shouldn't need to copy their profile photo to your own site. Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414906 Share on other sites More sharing options...
saschaoost Posted February 25, 2013 Author Share Posted February 25, 2013 you mean by just getting their profile picture url, store that in my database and display it through that url in an imc src attribute? Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414953 Share on other sites More sharing options...
Jessica Posted February 25, 2013 Share Posted February 25, 2013 I haven't used it so I can't say for sure, but you shouldn't need to store anything for it. I doubt you're allowed to copy the photos. That's not part of what you're given permission to do. Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414958 Share on other sites More sharing options...
saschaoost Posted February 25, 2013 Author Share Posted February 25, 2013 Ok thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/274930-problems-with-copy-function/#findComment-1414969 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.