如何与文件对象一起发送模型数据?

时间:2018-10-01 11:09:40

标签: javascript ajax asp.net-mvc

我有文件对象和模型数据,我想将数据发送到服务器端。

下面是我的Ajax代码

 var DebitOverrideSchedule =
    {
       BankAccID: BankAccountID,
       OvvrideFlag : 0,
       OverriderReason : OverriderReason,
       OverrideAction : OverrideAction,
       CurrentSettlementFreqPeriodValue : CurrentSettlementFreqPeriodValue,
       SettlementChangeRequestFreqPeriodValue : 
       CurrentSettlementFreqPeriodValue,
       CurrentSettlementFreqPeriodDesc : 
       SettlementChangeRequestFreqPeriodValue,
       SettlementChangeRequestFreqPeriodDesc : 
       SettlementChangeRequestFreqPeriodDesc,
       settlementCycle : settlementCycle
     };

    $.ajax({
        url: url,
        traditional: true,
        data: JSON.stringify(DebitOverrideSchedule),
        contentType: "application/json",
        type: 'POST',
        success: function (data)
        {
        }

现在,我想使用当前的ajax调用在模型数据中添加文件对象。让我知道可能的解决方案

0 个答案:

没有答案