问题描述
使用 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 (将#修改为@)