Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript angular和mvc 4将文件发布到服务器_Javascript_C#_Angularjs_Razor - Fatal编程技术网

Javascript angular和mvc 4将文件发布到服务器

Javascript angular和mvc 4将文件发布到服务器,javascript,c#,angularjs,razor,Javascript,C#,Angularjs,Razor,我有这样一个代码: Javascript $scope.saveChanges = function (bl) { console.log(bl) $http.post('@Url.Action("SaveChangesBudgetLine", "FinancialPlanning")', { amount: bl.Amount, month: bl.Month.id_bulan,

我有这样一个代码:

Javascript

$scope.saveChanges = function (bl) {
            console.log(bl)
            $http.post('@Url.Action("SaveChangesBudgetLine", "FinancialPlanning")', {
                amount: bl.Amount,
                month: bl.Month.id_bulan,
                year: bl.Year,
                newFile : bl.newFile
            })
            .then(function (resp) {
                console.log(resp)
            })
        }
c#:

javascript中的
newFile
具有如下值(客户端上的console.log):

但在服务器上,newFile为null

为什么会这样?如何解决这个案子?谢谢

[HttpPost]
        public ActionResult SaveChangesBudgetLine(String amount, int month, int year, HttpPostedFileBase newFile)
        {
            return Json(new { is_success = true, amount = amount, month = month, year = year, newFile = newFile });
        }
newFile: File
lastModified: 1440754532970
lastModifiedDate: Fri Aug 28 2015 16:35:32 GMT+0700 (SE Asia Standard Time)
name: "External.xlsx"
size: 964223
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
webkitRelativePath: ""