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 6241333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:45:00+00:00 2026-05-24T11:45:00+00:00

I am trying to upload the image using the webservices and Base64string. But each

  • 0

I am trying to upload the image using the webservices and Base64string.

But each time I am trying to upload the image it gives me BAD REQUEST (400) Error.

I have googled much about this, it says error is due to the large amount of data is been passed in request.

So I tried to increase the data length from web.config, but adding this.

 <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <!-- buffer: 64KB; max size: 64MB -->
        <binding name="FileTransferServicesBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
                 transferMode="Streamed" messageEncoding="Mtom" maxBufferSize="65536" maxReceivedMessageSize="67108864">
          <security mode="None">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>

But still it gives me the error.

here is my function.

[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)]
string AddAlbum(string imgstring)

And I am calling this function as follows :-

public string PostRemoteJSON(string strurl, string param)
        {
            try
            {
                strurl = "http://mydomain.com/EventService.svc/AddAlbum";
                param = "{\"imgstring\":\"BASE64STRINGCONTENT\"}";

            WebRequest myWebRequest;
            Stream myRequestStream;
            StreamWriter myStreamWriter;
            WebResponse myWebResponse;
            myWebRequest = WebRequest.Create(strurl);

            myWebRequest.Method = "POST";
            myWebRequest.Timeout = 1000000;
            myWebRequest.ContentType = "application/json";
            myWebRequest.ContentLength = param.Length;
            myRequestStream = myWebRequest.GetRequestStream();
            myStreamWriter = new StreamWriter(myRequestStream);

            myRequestStream = myWebRequest.GetRequestStream();

            myStreamWriter.Write(param);
            myStreamWriter.Flush();
            myStreamWriter.Close();
            myRequestStream.Close();

            myWebResponse = myWebRequest.GetResponse();

            StreamReader reader = new StreamReader(myWebResponse.GetResponseStream());
            return reader.ReadToEnd();

        }
        catch (Exception ex)
        {
            return ex.Message;
        }
    }

Please help me.

Thanks

  • 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-05-24T11:45:01+00:00Added an answer on May 24, 2026 at 11:45 am

    We were facing the same issue in our project. I assume you were having this issue while debugging your app. It seems like DevServer doesn’t support streamed bindings. If you have already tried to increase quotas and buffers, but it didn’t solve the issue, try to deploy your app in IIS, for us it all works fine in IIS environment.

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

Sidebar

Related Questions

i am trying to upload an image from a jsp page using servlet. but
I am trying to upload an image to server using using XMLHttpRequest but fails.
I'm trying to upload images using Graph API Batch Request, but i'm unable to
I am getting the following error when trying to upload an image using paperclip
I'm trying to upload an image to imageshack using flex, but keep getting <links>
Basically I am trying to upload an image using ASIFormDataRequest. This is my following
I am trying to upload an image to server using iphone . I haven't
I'm trying to develop image crop using JQuery. I use ajax to upload the
I am trying to upload an image of size 800kb using Ajax AsyncFileupload control
I'm trying to upload a picture to a specific website using php cURL but

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.