try this for html
<div type="file" ngf-drop ng-model="files" class="container drop-box text-center"
ngf-drag-over-class="dragover" ngf-multiple="true" ngf-allow-dir="true"
ngf-accept="'.jpg,.png'"><input type="hidden" name="image_id" >Drop Images here</div>
try this in you controller
controller: function($scope,$http,$timeout,Upload) {
$scope.$watch('files', function () {
$scope.upload($scope.files);
});
$scope.upload = function (files) {
if (files && files.length) {
for (var i = 0; i < files.length; i++) {
var file = files[i];
Upload.upload({
url: 'php/upload.php',
headers: {'Content-Type': file.type},
method: 'POST',
data: file,
file: file,
}).progress(function (evt) {
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
console.log('progress: ' + progressPercentage + '% ' + evt.config.file.name);
}).success(function (data, status, headers, config) {
console.log('file ' + config.file.name + 'uploaded. Response: ' + data);
$scope.image_submit = function() {
$http.post('php/slider.php?action=add_image',
{
'img_name' : config.file.name,
'img_src' : '../images/' + config.file.name
}
)
.success(function (data, status, headers, config) {
$scope.get_image();
})
.error(function(data, status, headers, config){
});
};
$scope.image_submit();
});
}
}
};
and this in your php file
<?php
$filename = $_FILES['file']['name'];
$destination = '../images/' . $filename;
move_uploaded_file( $_FILES['file']['tmp_name'] , $destination );
?>
You also need to create a db connection and create 2 php functions one to grab the images from the database and one to create the image and one function in your controller to get the image.The function to add image i have already give it to you in the controller.