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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:36:19+00:00 2026-05-15T02:36:19+00:00

I have a WCF Rest service: [WebHelp(Comment = Sample description for GetData)] [WebInvoke(Method=POST, UriTemplate

  • 0

I have a WCF Rest service:

      [WebHelp(Comment = "Sample description for GetData")]
    [WebInvoke(Method="POST", UriTemplate = "invoke", BodyStyle =WebMessageBodyStyle.Bare)]
    [OperationContract]
    public string GetData( Stream input)
    {
        long incomingLength = WebOperationContext.Current.IncomingRequest.ContentLength;
        string[] result = new string[incomingLength];
        int cnter = 0;
        int arrayVal = -1;
        do
        {
            if (arrayVal != -1) result[cnter++] = Convert.ToChar(arrayVal).ToString();

            arrayVal = input.ReadByte();
        } while (arrayVal != -1);

        return incomingLength.ToString();
    }

That I want to upload files (well, file; one at a time) to. Using this form to test:

    <form method="post" action="Service.svc/invoke" >
        <input type="file" name="aFile" />
    </form>
    <input type="button" onclick="document.forms[0].submit();" />

I can see the service receive the data, even though with the enctype of the form being set to ‘multipart/form-data’, only receive the element name and the name of the uploaded file. However, if I set the enctype, I get nothing; the service is never hit. I put a break in the code to see what was going on, and it was never reached. Do I need to do something special in the URITemplate attribute for the ‘multipart/form-data’ enctype? What else am I missing? For the heck of it, I used Fiddler to see what was being sent to the service with each option, and there was nothing sinister looking.

Without ‘multipart/form-data’:

POST /Service4/Service.svc/invoke HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Referer: <my machine>/Service4/form.htm
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8; .NET CLR 1.1.4322)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: okrd14144
Content-Length: 89
Connection: Keep-Alive
Pragma: no-cache

With:

POST /Service4/Service.svc/invoke HTTP/1.1
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
Referer: <my machine>/Service4/form.htm
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8; .NET CLR 1.1.4322)
Content-Type: multipart/form-data; boundary=---------------------------7da1ce3aa0bd0
Accept-Encoding: gzip, deflate
Host: okrd14144
Content-Length: 150119
Connection: Keep-Alive
Pragma: no-cache

I’m out of ideas

  • 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-15T02:36:20+00:00Added an answer on May 15, 2026 at 2:36 am

    Did you see this question? WCF service to accept a post encoded multipart/form-data

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

Sidebar

Ask A Question

Stats

  • Questions 426k
  • Answers 426k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Found the documentation. You want to do something like: public… May 15, 2026 at 12:44 pm
  • Editorial Team
    Editorial Team added an answer No. They won't be seen in transit, but they will… May 15, 2026 at 12:44 pm
  • Editorial Team
    Editorial Team added an answer You need to create an impossible.mli and compile that. That… May 15, 2026 at 12:44 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.