<input type="file" ng-model="articleimg" placeholder="upload related img">
$http.post($scope.base_url+'create.php',
{params {view:'view',articleimg:$scope.articleimg}})
.then(function(response){
console.log(response);
});
I would like to know how and where to specify the content-type: multipart/form-data in this angularjs post request?
Please assist. the default seems to be "application/json, text/plain," which does not work with the image/file uploads.
if(isset($_FILES['articleimg'])===true ){
echo "sucessfull";
}else echo "unsuccessfull";
the code above alway echos unsuccessfull.