I use the standard method of sending a file.
internal bool SendToServer(string filename)
{
if (null == _netSocket || !_netSocket.Connected) CreateSocketConnect();
try
{
_netSocket.SendFile(filename);
File.Delete(filename);
return true;
}
catch (SocketException ex)
{
CloseSocketConnect();
string error = string.Format("exception: {0} error code: {1} stacktrace: {2}", ex.Message, ex.ErrorCode, ex.StackTrace);
_twriter.AddMessage(string.Format("-> {0}", error));
Logger.Instance.WriteLine(ex.Message);
}
return false;
}
But there is one problem. If the file is large, more than 1.5 GB, then I get an error WSA_INVALID_PARAMETER - 87
How can I fix this and can I even do it or look for another option for sending the file?