-3

I am uploading image from android device to WCF service. The android phone captures 5 MB file and that file is converted to base64string and passing to WCF service. I have two problems

  1. if I pass small image the image will be uploaded.
  2. if I pass 2 MB file, the file size goes to 0 bytes and getting OUTOFMEMORY exception

here I tried two ways 1.multipartparser and 2.stream

Anthon
  • 69,918
  • 32
  • 186
  • 246
P Mahesh
  • 1
  • 3

1 Answers1

0

I think it is because of the maximum size of your buffer. If you have access to service you need to update you config file as below:

 <binding name="basicHttp" allowCookies="true"
             maxReceivedMessageSize="20000000" 
             maxBufferSize="20000000"
             maxBufferPoolSize="20000000">

As a good sample you can check out the link below: WCF - How to Increase Message Size Quota

Community
  • 1
  • 1
Nick Mehrdad Babaki
  • 11,560
  • 15
  • 45
  • 70