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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:00:08+00:00 2026-05-10T15:00:08+00:00

What is the best way to create a webservice for accepting an image. The

  • 0

What is the best way to create a webservice for accepting an image. The image might be quite big and I do not want to change the default receive size for the web application. I have written one that accepts a binary image but that I feel that there has to be a better alternative.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T15:00:09+00:00Added an answer on May 10, 2026 at 3:00 pm

    Where does this image ‘live?’ Is it accessible in the local file system or on the web? If so, I would suggest having your WebService accepting a URI (can be a URL or a local file) and opening it as a Stream, then using a StreamReader to read the contents of it.

    Example (but wrap the exceptions in FaultExceptions, and add FaultContractAttributes):

    using System.Drawing; using System.IO; using System.Net; using System.Net.Sockets;  [OperationContract] public void FetchImage(Uri url) {     // Validate url      if (url == null)     {         throw new ArgumentNullException(url);     }      // If the service doesn't know how to resolve relative URI paths      /*if (!uri.IsAbsoluteUri)     {         throw new ArgumentException('Must be absolute.', url);     }*/      // Download and load the image      Image image = new Func<Bitmap>(() =>     {         try         {             using (WebClient downloader = new WebClient())             {                 return new Bitmap(downloader.OpenRead(url));             }         }         catch (ArgumentException exception)         {             throw new ResourceNotImageException(url, exception);         }         catch (WebException exception)         {             throw new ImageDownloadFailedException(url, exception);         }          // IOException and SocketException are not wrapped by WebException :(                      catch (IOException exception)         {             throw new ImageDownloadFailedException(url, exception);         }         catch (SocketException exception)         {             throw new ImageDownloadFailedException(url, exception);         }     })();      // Do something with image  } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is best way to create a blinking image animation in wp7? Is there
What is the best way to create instance of CCSprite from downloaded image file?
What is the best way to create databases on C# application, I mean by
What is the best way to create multi-language database? To create localized table for
What is the best way to create a unique id column for table records
What is the best way to create a 'global event' in flex/actionscript - preferably
What is the best way to create a static variables for jQuery plugins? I
What's the best way to create a model in Ruby on Rails that doesn't
What is the best way to create a custom UIView that I can consume
What's the best way to create a file under a nested folder in Sharepoint

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.