HttpPostedFileBase does not contain a definition of 'RecipeId'
I tried adding another data like this
angular.forEach($scope.SelectedFiles, function (value, index) {
$scope.SelectedFiles[index]["RecipeId"] = $scope.recipeID;
});
and then I check it in alert by JSON.stringify and this was the result
[{"RecipeId":0},{"RecipeId":0}]
but I still could not access it in Files/Upload/ controller.
and another problem I have is that postedFile.FileName and path is not saving to db, even file id was not saving. It should atleast save id since it's database generated but it doesn't, is this wrong Models.File recipefile = new Models.File(); ?
I have using System.IO; since I want it to auto create a dir if it is not available. I tried removing it but Id, Nameand Path is not saving.
I want to add
$scope.recipeID
to the upload request to controller, I tried the followingthen called it in the controller like so
but it returned an error
HttpPostedFileBase does not contain a definition of 'RecipeId'
I tried adding another data like this
and then I check it in alert by JSON.stringify and this was the result
[{"RecipeId":0},{"RecipeId":0}]
but I still could not access it in Files/Upload/ controller.
and another problem I have is that postedFile.FileName and path is not saving to db, even file id was not saving. It should atleast save id since it's database generated but it doesn't, is this wrong
Models.File recipefile = new Models.File();
?I have using
System.IO;
since I want it to auto create a dir if it is not available. I tried removing it butId
,Name
andPath
is not saving.