This commit is contained in:
artyom 2019-01-04 12:54:40 +03:00
Родитель 4c75d5b7ca
Коммит 7f36edd826
1 изменённых файлов: 15 добавлений и 4 удалений

Просмотреть файл

@ -80,14 +80,25 @@ namespace Camelotia.Services.Providers
return Task.CompletedTask;
}
public Task UploadFile(string to, Stream from, string name)
public async Task UploadFile(string to, Stream from, string name)
{
throw new NotImplementedException();
using (var connection = _factory())
{
await connection.ConnectAsync();
var path = Path.Combine(to, name);
await connection.UploadAsync(from, path);
await connection.DisconnectAsync();
}
}
public Task DownloadFile(string from, Stream to)
public async Task DownloadFile(string from, Stream to)
{
throw new NotImplementedException();
using (var connection = _factory())
{
await connection.ConnectAsync();
await connection.DownloadAsync(to, from);
await connection.DisconnectAsync();
}
}
}
}