Login with Facebook - Iserir profile image in a <input type="file">

Asked

Viewed 76 times

1

good afternoon.

Do you have any way to get the login with facebook, take the profile image of the user and "store" in an input type="file" of a form? To work as if the user had uploaded this image.

Example: I know you have how to login take the Username and store it in the value="" of an input, but I don’t know how to do it for files.

Thank you.

  • Hello.. At first, if you can get a user’s public_profile, it has the "picture", which is the person’s profile picture... Apparently returns a link to the person’s photo. That’s enough?

1 answer

1


It has several ways to get the profile image of the user, through the ID on the web, we can achieve as follows:

http://graph.facebook.com/" + facebookId + "/picture? type=square http://graph.facebook.com/1222810918/picture?type=square

Both the ID and the p/image link can be returned on login with the facebook API. There are other types(sizes), for more information a look here.

Now, store via code a file in a <input type="file" /> I don’t think it’s possible for security reasons. It is worth giving a rethink on how to do this part of simulating the user by uploading a facebook image.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.