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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:37:50+00:00 2026-06-03T05:37:50+00:00

I am developing a WinForms application and want to send a binary image data

  • 0

I am developing a WinForms application and want to send a binary image data to web application. How does it work?

I coded this:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";

request.AllowWriteStreamBuffering = true;
request.KeepAlive = true;                
request.Credentials = System.Net.CredentialCache.DefaultCredentials;

var fc = GetFileContent(varsayilanResimGuid);
byte[] postBytes = fc.Dosya;
request.ContentLength = postBytes.LongLength;
Stream requestStream = request.GetRequestStream();               
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();                

HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string content = new StreamReader(response.GetResponseStream()).ReadToEnd(); 

and how to receive this binary image content by me in .ashx ?

  • 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-03T05:37:51+00:00Added an answer on June 3, 2026 at 5:37 am

    I question and I answer.
    how to receive a binary image:

    Stream gelenResim = context.Request.InputStream;
    
    if (gelenResim.Length == 0) 
    {
        e.Resim = "/Content/EmlakDetayImaj/Noimages.jpg";
    }
    
    string guidim = Guid.NewGuid().ToString().Substring(0, 4);
    var KaydetResimDosya = "/Content/EmlakDetayImaj/" + guidim + ".jpg";
    
    using (FileStream fileStream = System.IO.File.Create(context.Server.MapPath("~/Content/EmlakDetayImaj/" + guidim + ".jpg"), (int)gelenResim.Length))
    {
        byte[] bytesInStream = new byte[gelenResim.Length];
        gelenResim.Read(bytesInStream, 0, (int)bytesInStream.Length);
        fileStream.Write(bytesInStream, 0, bytesInStream.Length);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a winforms application and I have a scenario where I want
I'm developing a WinForms application (.Net 3.5, no WPF) where I want to be
While developing a WinForms application, I came across what I believe is a bug
We are developing a multilingual Winforms application using visual studio 2008. I am trying
I'm developing a WinForms c# 3.0 application. Our designer created quite a lot of
I'm developing a .NET application that will have both a WinForms and a Silverlight
I'm developing a WinForms app in VB.NET, that handles sets of style data, and
I am developing a winforms application using .NET 2.0 and Sql Server 2005. I
I'm developing an application (winforms C# .NET 4.0) where I access a lookup functionality
I am currently developing a Winforms Application that will run on a very specific

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.