You need to check streaming, as Dmitry already pointed out.
To send large files as a stream to a service, you need to:
- create a service method that takes
Streamas its input parameter - create a binding configuration (both on the server and on the client) that uses
transferMode=StreamedRequest - create a thread in your client and send it to the service method
So, first you need a way in your service contract:
[ServiceContract]
interface IYourFileService
{
[OperationContract]
void UploadFile(Stream file)
}
Then you need the binding configuration:
<bindings>
<basicHttpBinding>
<binding name="FileUploadConfig"
transferMode="StreamedRequest" />
</basicHttpBinding>
</bindings>
, :
<services>
<service name="FileUploadService">
<endpoint name="UploadEndpoint"
address="......."
binding="basicHttpBinding"
bindingConfiguration="FileUploadConfig"
contract="IYourFileService" />
</service>
</services>
, , , . filestream , .
, !