[英]How to upload file to Asmx Web Service action
這是一個非常初學者的問題,但我不熟悉如何使用HttpContext.Current.Request.Files
假設我的webService網址為:
http://127.0.0.1/iisEntry/myApi.asmx
有人可以請一些快速代碼編寫如何將文件上傳到以下網絡方法嗎?
public void AddDocument(String title)
{
var action = new AddDocumentAction
{
File = HttpContext.Current.Request.Files[0],
DocumentTitle = title
}
processor.Process(action);
}
HttpContext.Current.Request.Files包含通過POST請求上傳的文件,其編碼類型為“ multipart / form-data”。 ASMX Web服務只能處理基於XML / SOAP的請求,因此您將無法以這種方式上傳文件。
選項有:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.