Login with Facebook - Insert profile image into an input type="file"

1

Good afternoon.

Have some way to get facebook login, take the user profile image and "store" in an input type="file" of a form? To function as if the user had uploaded this image.

Example: I know I have login to get User Name and store in value of an input, but I do not know how to do this for files.

Thank you.

    
asked by anonymous 19.04.2017 / 22:17

1 answer

1

There are several ways to achieve the user profile image, through the web ID, we can achieve this as follows:

link "+ facebookId +" / picture? type = square link

Both the ID and the image link can be returned in the login with the facebook API. There are other types (sizes) for more information at a glance here .

Now storing a file in <input type="file" /> via code is not possible due to security issues. It's worth giving a rethink on how to do this part of simulating the user by uploading a facebook image.

    
20.04.2017 / 00:20