private ResponseFile DownloadFile(RequestFile request)
        {
            ResponseFile result = new ResponseFile();

            FileStream stream = this.GetFileStream(Path.GetFullPath(request.FileName));
            stream.Seek(request.byteStart, SeekOrigin.Begin);
            result.FileName = request.FileName;
            result.Length = stream.Length;
            result.FileByteStream = stream;
            return result;

        }
        public void UploadFile(ResponseFile response)
        {

            string filePath = Path.GetFullPath(response.FileName);

            int chunkSize = 2048;
            byte[] buffer = new byte[chunkSize];

            using (FileStream stream = new FileStream(filePath, FileMode.Append, FileAccess.Write))
            {
                do
                {
                    int readbyte = response.FileByteStream.Read(buffer, 0, chunkSize);
                    if (readbyte == 0) break;

                    stream.Write(buffer, 0, readbyte);
                } while (true);
                stream.Close();
            }
        }
 public async Task StartUploadFile(ResponseFile response)
 {
     await Task.Run(() => UploadFile(response));
 }
 public void Upload(ResponseFile response)
 {
     Task.Run(async () => await _serviceExecutor.Execute(s => s.WcfUploadFile(response)));
 }
 public async Task WcfUploadFile(ResponseFile response)
 {
     return _transferService.StartUploadFile(response);
 }