Hi,
i want upload files whit ftp to an other server but when i use these codes ,
its created file in host but the size of file is 0 bytes and return error
public async Task<IActionResult> Create( IFormFile file)
{
FtpClient client = new FtpClient("144.76.30.231"); client.Credentials = new NetworkCredential("yavarani", "*********"); client.Connect(); using (var stream = new StreamReader(file.OpenReadStream())) { client.UploadAsync(stream.BaseStream, "/yavarani/yavaraniha.ir/wwwroot/Files/Videos/" + aVF.FileNameOrLink).Wait(); }
}
Error :
timed out trying to read data from the socket stream