public ShepFile ShepFileUpload(byte[] file, string fileName) { ConfigShepUploader.UrlWebService = @"http://" + _configuration.ServerPepIp + @"/SHEP_UL_FileUploaderService/UploaderService"; var shepFile = new ShepFile { Name = fileName, Md5hash = ShepFileClient.GetHash(file), ID = ShepFileClient.Upload(file, fileName) }; return(shepFile); }
public byte[] ShepFileDownload(ShepFile shepFile) { ConfigShepUploader.UrlDownload = @"http://" + _configuration.ServerPepIp + @"/SHEP_UL_FileUploaderService/DownloadFile?FileId={0}"; var bytes = ShepFileClient.Download(shepFile.ID, shepFile.Name, shepFile.Md5hash); if (bytes == null || bytes.Length == 0) { throw new ArgumentException("ШЭП-файл пуст. ShepFile.ID = " + shepFile.ID); } return(bytes); }