2

I want to get the users facebook profile picture and save it to a folder inside the project folder. By using this I can get the facebook pic; it displays the pic. Is there any possible way to download this picture and store inside a particular folder?

function getPhoto() { FB.api('/me/picture?type=normal', function(response) { var str="<br/><b>Pic</b> : <img src='"+response.data.url+"'/>"; document.getElementById("status").innerHTML+=str; }); 
10
  • Can you also access the FB user server-side, as in do you have him authenticated there, you could or upload the response.data.url or just make a FB API call from the server Commented Sep 1, 2014 at 7:05
  • Why don't you use server side scripting language like PHP for this??? Commented Sep 1, 2014 at 7:08
  • server side is in python. I didn't write anything there. I just tried out this hayageek.com/facebook-javascript-sdk and it's working. I only want to get the facebook profile pic not other details. Commented Sep 1, 2014 at 7:08
  • You can simply send url of profile pic using ajax to python and save it as you want. @MichelleDeWaasGunawardena Commented Sep 1, 2014 at 7:10
  • @Manwal I'm kind of new to this python and web development. So if I send the image URL to python can I save the image in a static folder? Commented Sep 1, 2014 at 7:20

2 Answers 2

0

javascript can't access files in the browser, you can do it on the server with nodejs. You can only store cookies in the browser.

Read/write to file using jQuery

Sign up to request clarification or add additional context in comments.

Comments

0

You got facebook profile URL right.. Then send it to backend via Ajax. You problem will be solved.

2 Comments

I'm kind of new to this python and web development. So if I send the image URL to python can I save the image in a static folder?
Yes.. You can download image using the URL in your python and store it in your folder

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.