Click here to Skip to main content
15,886,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

1. Server-side: I have a method that intends on receiving the byte[] from WebClient.UploadData but I can not seem to achieve this.
2. I have tried the following:
- System.IO.Stream which results in an error "Cannot create an abstract class".
- System.IO.MemoryStrem which results in an error "Timeouts are not supported on this stream".
- byte[] - The input parameter is null.
- Google, which took me in circles :(

Client-side code: Posting data using WebClient.UploadData
C#
byte[] _data = Encoding.UTF8.GetBytes(parameters);
byte[] _result = client.UploadData(_URL, _data); // client: System.Net.WebClient


Server-side: Attempting to receive the data posted by WebClient.UploadData
C#
public byte[] Receive_Data(Stream data) // System.IO.Stream
{
 ...
}

public byte[] Receive_Data(MemoryStream data) // System.IO.MemoryStrem
{
 ...
}

public byte[] Receive_Data(byte[] data) // byte[]
{
 ...
}


I'm not sure what I doing wrong, please could someone point me in the right direction/alternative. All feedback is highly appreciated.

Notes: This being done in MVC
C#
public class HomeController : Controller
Posted
Updated 7-Apr-15 7:03am
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900