How can I change the profile picture with anywhere?


I’m using anywhere for an app that must allow the users to change their profile picture. As far as I know, the anywhere T object does not include a default connection with POST account/update_profile_image, so I tried to sent a custom post request, but it says that the “Origin is not allowed by Access-Control-Allow-Origin”. I know it can be done with server-side authentication, but: Is there a way to do it with anywhere?

Thanks a lot.


Hi @sadasant,

As you’ve discovered, @Anywhere doesn’t support image uploads/profile image uploads. This is currently only supported through server-to-server integrations.


:frowning: ok, thanks.


What about a plugin to the anywhere api? I’m reading the api.bundle.js and I think something like this should work:

(function () { var B = twttr.anywhere.api.util.chainableMethod; var C = twttr.anywhere.api.util.aliasMethod; var A = twttr.anywhere.api.util.callMethod; twttr.anywhere.api.util.model("twttr.anywhere.api.models.ProfileImage").belongsTo("User").statics({ send: B("ProfileImage", function (I) { A({ url: "update_profile_image", params: [{ image: I }], dataSource: ["profile_image"] }) }) }); }());

Any clues?


Or, I know how to confirm the user on the server with the twitter_anywhere_identity, is there a way to obtain the oauth privileges with this so I could upload the profile image?

edit: I’ve read about oauth_bridge_code, does it still working?


We don’t support using the underlying JSAPI that powers @Anywhere. I wouldn’t recommend this approach.


The oauth_bridge_code approach was never officially supported and has been removed. Server-based OAuth is really the best way to accomplish these goals.


Ok thank you :slight_smile:


Suhani Sham Aur Chandni Raaten
Jharno Ka Paani,Barsaat Ka Mausam
Tere Bin Jalwagaar Na The
Tez Dhoop Aur Garam Hawayen
Aankh Ka Paani,Ghamon Ka Mausam
Ye Sach Hai ,Tere Sang Asardaar Na The.