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

  • Home
  • SEARCH
  • 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 8664437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:14:25+00:00 2026-06-12T17:14:25+00:00

I am sending a JSON message including filename, and a base64encoded image to a

  • 0

I am sending a JSON message including filename, and a base64encoded image to a WCF service. I am not really sure on how to convert it back to the image, more specificallly deserializing the return stream.

WCF Interface

 [OperationContract]
        [WebInvoke(
            Method = "POST",
            UriTemplate = "/UploadImage", ResponseFormat =  WebMessageFormat.Json,
            RequestFormat =  WebMessageFormat.Json)]
        string UploadImage(Stream image);

And some part of the message(which I save to a file so I can view and try to understand)

--hr56lXG6Q_hKg5opmTx4xejr28dU17AC
Content-Disposition: form-data; name="entity"

{"filename":"mypicture.jpg","thebigfile":"\/9j\/4Re6RXhpZgAATU0AKgAAAAgACwEPAAIAAAAOAAAAkgEQAAIAAAAGAAAAoAESAAMAAAABAAYAAAEaAAUAAAABAAAApgEbAAUAAAABAAAArgEoAAMAAAABAAIAAAExAAIAAAATAAAAtgEyAAIAAAAUAAAAygITAAMAAAABAAEAAIdpAAQAAAABAAAA3oglAAQAAAABAAACegAAAoBTb255IEVyaWNzc29uAExUMjZpAAAAAEgAAAABAAAASAAAAAE2LjEuQS4yLjQ1XzUzX2YxMDAApDIwMTI6MTA6MDYgMDk6MzI6MTcAABiCmgAF
        and lots more of the base64 encoded image....
        --hr56lXG6Q_hKg5opmTx4xejr28dU17AC--

How do I deserialize this? Is Stream the way to go? I do not simply want to remove the top rows and then start deserializing the JSON array, I want to know WHY it looks like this.

  • 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-12T17:14:26+00:00Added an answer on June 12, 2026 at 5:14 pm

    To process the message you gave, the OperationContract needs to look something like:

    [WebInvoke(Method=”POST”, UriTemplate=”/UploadImage”, BodyStyle=WebMessageBodyStyle.WrappedRequest, ResponseFormat=WebMessageFormat.Json, RequestFormat=WebMessageFormat.Json)]
    [OperationContract]
    string UploadImage(string filename, string thebigfile);

    See http://msdn.microsoft.com/en-us/library/bb885100.aspx for more information

    You would then need to manually Base64-decode the “thebigfile” parameter using the decoder provided by the .NET Framework. There is no built-in support for Base64 inside JSON as far as I know, see http://msdn.microsoft.com/en-us/library/bb412170.aspx for details on how various data types are supported.

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

Sidebar

Related Questions

when I'm sending JSON response to jqgrid I get undefined message across it and
I am trying to receive a json object back from php after sending data
I would like to use JSON for sending multiple variables like status, error-message and
I am configuring a RESTful web service via Spring, with various representations, including JSON.
I am sending a JSON message via XHR in a post request (content type:
I'm sending the following json message via POST request: { ID:17, FIRST_NAME:John, LAST_NAME:Doe, TOKEN:8cdde0ef552e305cb44e143d3f8c742fb35caab8f360e7
I get the following error message when sending an ajax request: Invalid JSON: {html:,jobNum:0}<!DOCTYPE
I'm sending a JSON message using this PHP : $result = mysql_query(select a.id, ad.nombre,
I've created a WCF service which I intend to use when sending data from
I am sending JSON: [ { Description: A kud ces bolje, ItemID: 1, Name:

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.