Angular Multiple File Upload with PHP MySQLi

Today, We want to share with you Angular Multiple File Upload with PHP MySQLi.
In this post we will show you PHP Angular multi-file upload, hear for AngularJS Multiple File Upload with PHP/MySQLi we will give you demo and example for implement.
In this post, we will learn about File Upload Using AngularJS with PHP MySQLi with an example.

Angular Multiple File Upload with PHP and MySQLi

There are the Following The simple About Angular Multiple File Upload with PHP and MySQLi Full Information With Example and source code.

Steps 1: Make MySQL Database Table
CREATE TABLE `multiple_img` (
`id` int(11) NOT NULL,
`img_name` varchar(255) NOT NULL

READ :  ASP.NET URL Routing Web Forms Application

Steps 2: Add simple Bootstrap and Angular libs

Steps 3: Make File Upload Form



Angular File Upload with PHP and MySQL


Steps 4: Handle Angular File Upload


var infinityApp = angular.module(“infinityApp”, []);
infinityApp.directive(“fileInput”, function($parse){
link: function($scope, element, attrs){
element.on(“change”, function(event){
var files =;
$parse(attrs.fileInput).assign($scope, element[0].files);
infinityApp.controller(“infinityCtrl”, function($scope, $http){
$scope.liveFileUpload = function(){
var form_data = new FormData();
angular.forEach($scope.files, function(file){
form_data.append(‘file[]’, file);
$‘image_upload.php’, form_data,
transformRequest: angular.identity,
headers: {‘Content-Type’: undefined,’Process-Data’: false}
$scope.show_multiple_img = function(){
$scope.uploaded_multiple_img = data;

Steps5: Handle Multiple Images Upload at Server End

READ :  Angular Insert Update Delete Using PHP MySQLi


$upload_dir = “upload/”;
$upload_file = $upload_dir.$_FILES[‘file’][‘name’][$key];
$filename = $_FILES[‘file’][‘name’][$key];
$insert_sql = “INSERT INTO multiple_img(img_name) VALUES (‘”.$filename.”‘)”;
mysqli_query($conn, $insert_sql) or die(“database error: “. mysqli_error($conn));
echo ‘File uploaded and saved in database successfully.’;

Steps 6: Display Upload Images




jQuery 15 Powerful Tips and Tricks for Developers and Web Designer

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about how to upload multiple files in php and store in database demo.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

READ :  Autocomplete multiselect directive select values using angularjs

Leave a Reply

Your email address will not be published. Required fields are marked *