Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8994035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:19:55+00:00 2026-06-15T23:19:55+00:00

I am trying to post image to user wall using javascript FB.api. Image is

  • 0

I am trying to post image to user wall using javascript FB.api. Image is generated from a java servlet dynamically, but due to asynchronous behavior before the image is generated it passes control below the block to post image to Facebook part.
I want either

  1. how can I make fb.api post to Facebook call from servlet?
  2. how to deal with this behavior so that control will not passes below before image generation?

note servlet is working file and generating image .

var imgURL="http://xxx.xxx.xxx.xxx:8084/myapps/app1?monthly="+monthly+"&recent="+recent+"&likes="+likes;

//var imgURL="http://xxx.2xx.xx6.1x8:8084/WebApplication6/image";
alert('image');
//var imgURL="https://graph.facebook.com/100000329585395/picture";
var img = document.createElement('img');
img.src =imgURL;
document.body.appendChild(img);


FB.api('/me/photos', 'post', {
message:'image',
url:imgURL        
                       }, function(response){
                           alert('here');

if (!response || response.error) {
    alert('Error occured'+response.error);
} else {
    var postId = response.id;
     alert(postId);}


});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:19:56+00:00Added an answer on June 15, 2026 at 11:19 pm

    Check RESTFB Api which is a Java API. You can use this instead of Javascript API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to post to a user wall using the Graph API. I
I am trying to post an image to facebook grap api using asp.net ,
I'm trying to post a photo to Facebook page from user using Facebook SDK
I am trying to post an image to a Facebook album using a form
i'm trying to post an image to my users's facebook wall once they hit
I've been trying to Base64 encode image data from the user (in this case
I am trying to post a message to a user's feed (wall). I've already
I am trying to upload an image using django and following a tutorial from
I'm trying to post a Facebook status update, using the Facebook iOS API, with
I am trying to post text from my iPhone app to my wall on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.