Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Image storing through Rest Webservices in DB.

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Image storing through Rest Webservices in DB.

    Hi All,

    I am looking for a solution to recieve an image in webservices through my client(Android application).
    I am sending an image as a string(converting image to byte array and then byte array to Base64String).While recieving at server end (in services ) i need to decode the string back to image so i am using following code.

    byte[] decode=Base64.decodeBase64(signature.getBytes());
    BufferedImage img = ImageIO.read(new ByteArrayInputStream(decode));

    FileOutputStream fos = new FileOutputStream(imageFile);
    fos.write(decode);

    here:
    signature is the string recieved from client end.
    imageFile is the path (in the code) to save the image in the required folder .

    By above code i am recieving the blank image with some bytes(ex.7 bytes).
    wanted to fetch the complete image not the bytes.


    Please give some solution for the code.
    Any new solutions are appreciated.


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Image storing through Rest Webservices in DB.

    Welcome Surabhi16

    Can you post the code you are having problems with?

    Moved from Member Introductions

Similar Threads

  1. why webservices.seekda.com site is not working for webservices
    By sanjayvenkat in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 6th, 2013, 04:48 AM
  2. Rest client
    By skuskusas in forum Android Development
    Replies: 0
    Last Post: December 18th, 2012, 08:48 AM
  3. java webservices
    By kuzhali in forum Web Frameworks
    Replies: 3
    Last Post: April 25th, 2011, 05:24 AM
  4. Square Game (a half solved, please help with the rest!!!)
    By LadyBelka in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 23rd, 2011, 04:42 PM
  5. let first thread through, the rest has to wait
    By hamsterofdeath in forum Threads
    Replies: 0
    Last Post: November 19th, 2010, 01:32 PM

Tags for this Thread