Jquery plugins 通过Jquery模式上传图像
我想使用jquery模式将照片上传到我的应用程序ASP.net mvc 首先,我创建了将在模式中显示的div,如下所示:Jquery plugins 通过Jquery模式上传图像,jquery-plugins,Jquery Plugins,我想使用jquery模式将照片上传到我的应用程序ASP.net mvc 首先,我创建了将在模式中显示的div,如下所示: <div id="dialog-form" title="Upload File"> <p> <input type="file" id="fileUpload" name="fileUpload" /> </p> </div> $("#dialog-form")
<div id="dialog-form" title="Upload File">
<p>
<input type="file" id="fileUpload" name="fileUpload" />
</p>
</div>
$("#dialog-form").dialog({
bgiframe: true,
height: 200,
modal: true,
autoOpen: false,
resizable: false,
buttons: {
Cancel: function () {
$(this).dialog('close');
},
Ok: function () {
$.ajax({
type: "POST",
url: '<%: Url.Action("Upload", "SomeController") %>',
success: function (result) {
if (result.Success == true) {
alert(result.Message);
}
}
});
}
}
});
然后,当我按下某些Hyberlink时,会出现模态,当我按下ok时
我想把这张照片带到行动控制器进行一些处理
我不知道如何将我的照片传送到服务器
模态代码如下所示:
<div id="dialog-form" title="Upload File">
<p>
<input type="file" id="fileUpload" name="fileUpload" />
</p>
</div>
$("#dialog-form").dialog({
bgiframe: true,
height: 200,
modal: true,
autoOpen: false,
resizable: false,
buttons: {
Cancel: function () {
$(this).dialog('close');
},
Ok: function () {
$.ajax({
type: "POST",
url: '<%: Url.Action("Upload", "SomeController") %>',
success: function (result) {
if (result.Success == true) {
alert(result.Message);
}
}
});
}
}
});
我应该使用$.ajax..中的数据吗。。但是怎么做呢?
我的控制者不希望我有任何签名。。。
公共JsonResult上传,如下所示
它在Request.files中查找上载的文件
比如:
请求文件中的foreach字符串InputAgName
{
一些加工
}
请提供任何帮助???注意:我已尝试将提交按钮添加到我的div中,并在表单中包含hole div,并尝试通过指定action属性提交文件。。但是什么也没发生你不能把你需要的数据作为参数传递给你的控制器吗?我假设我可以把它作为参数传递。。。如何将照片传送到服务器。。。什么样的数据类型?可能重复的