【发布时间】:2012-08-04 14:55:15
【问题描述】:
我有一个 WCF 服务,它使用 Stream 类上传文档。
在此之后,我想获取文档的大小(流的长度),以更新 FileSize 的 fileAttribute。
但是这样做,WCF 会抛出一个异常说
Document Upload Exception: System.NotSupportedException: Specified method is not supported.
at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.get_Length()
at eDMRMService.DocumentHandling.UploadDocument(UploadDocumentRequest request)
谁能帮我解决这个问题。
【问题讨论】:
-
您应该从客户端发送
Length。 -
我无法从客户端发送 FileSize,因为没有专门的属性