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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:47:52+00:00 2026-06-09T21:47:52+00:00

I have an asp.net web api application which is acting as a Relay to

  • 0

I have an asp.net web api application which is acting as a Relay to a wcf web service. In certain scenarios I want to upload large files. The methods in the wcf service accept files as stream.
I do not want to save the files on my intermediate server I want to access the stream of the uploaded file and provide it to the wcf method so that the data is directly streamed to the wcf service.

Here is similar scenario when client is downloading the file

using (IProductsChannel channel = ChannelFactory.CreateChannel())
            {
                result.Content = new StreamContent(channel.GetFile());
                result.Content.Headers.ContentType = new MediaTypeHeaderValue("text/plain");
                return result;
            }
  • 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-09T21:47:54+00:00Added an answer on June 9, 2026 at 9:47 pm

    Here is at least one way of doing it. using the HTTPContext the only problem with this one is that it is not good for unit testing so we have to abstract it out in the final solution.

     var file =   HttpContext.Current.Request.Files[0];
    
    
                var result = new HttpResponseMessage(HttpStatusCode.OK);
    
                using (IProductsChannel channel = ChannelFactory.CreateChannel())
                {
                    channel.SaveFile(file.InputStream);
                }
    
                return  new HttpResponseMessage(HttpStatusCode.Created);
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET 4.0 web application which uses a third-party API for external
I have an ASP.NET MVC 4 application which uses the new ASP.NET Web API.
We currently have a classic ASP.NET web application which serves as our API. It
I have an ASP.NET Web API (version 4) REST service where I need to
I've written an ASP.NET 2.0 web service which is consumed by a web application
I am developing a ASP.Net Web API application and I have used AuthorizeAttribute for
I have a layered web application that I built with ASP.NET MVC 4, WebAPI
Using the ASP.NET Web-Api, I have the following POST setup in my controller. When
I have the following action in my ASP.NET Web API: public IEnumerable<Car> carssOfUser(int id,
I have a Asp.net WebAPI service that is hosted on AppHarbor which throws 404

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.