在 localFileSytem 上使用 .net Client (ITHitWebDAVClientNet_2_0_477) +ITHit.WebDAV.Server.6.1.4288 和 IIS 恢复文件上传

问题描述

使用 ITHit.WebDAV.Client 并尝试恢复暂停的上传上传没问题,但恢复使文件损坏

暂停上传

//close saved transfer stream
 try
   {
    localFile.TransferTask.WebStream.Close();
   }
   catch (WebDavHttpException)
   {
   }

上传或恢复(简化代码

long uploadedBytes = 0;
f.AllowWriteStreamBuffering = true;

if(IsServerResumable && resuming){
  uploadedBytes = f.Resumableupload.GetBytesuploaded(); 
}

 using (Stream webstream = file.Resumableupload.GetWriteStream(uploadedBytes,toUpload,fileSize,null,lockToken))

savedbytes =  uploadedBytes + fileBytesRead;
etc...

File.Resumableupload.GetBytesuploaded() 始终返回总文件大小。尝试使用保存的字节,但文件已损坏

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)