WCF サービスを介してファイルをアップロードしています。
[OperationContract(Name = "UploadManual")]
[DataContractFormat]
[WebInvoke(Method = "POST",
UriTemplate = "UploadManual/",
BodyStyle = WebMessageBodyStyle.Bare,
ResponseFormat = WebMessageFormat.Json)]
string UploadManual(Stream Uploading);
実装
public string UploadManual(Stream Uploading)
{
using (FileStream writer = File.Create(System.Web.Hosting.HostingEnvironment.MapPath("~/ProductManual/Temp.txt")))
{
Uploading.CopyTo(writer);
}
return "Response"
}
ただし、ファイルは以下のようにメタデータとともに保存されます。
---------------------------acebdf13572468 Content-Disposition: フォーム データ。name="fieldNameHere"; filename="FileName.txt" Content-Type: text/plain ファイルの内容 ---------------------------acebdf13572468--
しかし、コンテンツのみをファイルに保存したい。問題を解決するにはどうすればよいですか?