简体   繁体   中英

Add external file to $_FILES array with javascript/jquery

I have the following case:

I have a third party plugin in my expression engine site that handles my user registrations. It also handles profile picture uploads (which is part of the registration process).

I want to add a feature for grabbing the user profile picture from Facebook during registration. As I don't want to tinker with the third party plugin, I'm looking for a way to solve this on the client side by sending the profile pic from Facebook directly into the php $_FILES array when the registration form is submitted (so the third party plugin can pick it up from there).

Is there anyway to do this?

The answer is: no you cannot. Same origin policy (amongst other things) makes this impossible. The only way to do this is to take information about the user's Facebook account and get it server side using the FB APIs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM