我有fileupload和一些输入文本,我想使用WCF更新值到数据库。发送文件上载到WCF
到目前为止,我通过字符串数组发送所有的输入值,但我不能看到如何使用WCF
HTML上传文件到服务器:
<input id="file" type="file" >
<textarea name="textarea" class="jqte"> </textarea>
...
的javascript:
$.ajax({
url: "/WebServices/forum.svc/InsertMessage",
type: "POST",
data: JSON.stringify({ currentMessage: currentMessage }),
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (data) {
}
});
WCF:
[OperationContract]
public void InsertMessage(List<string> currentMessage)
{
return;
}
任何想法如何解决这个问题?
感谢
Baaroz
使用uplick.js ...它使你的任务超级简单..我做了同样的错误发送ajax文件..我失败了...使用iframe或一些JS ..这可能会有所帮助..只是谷歌js文件上传..有很多js可用.. –