AngularJS Store and Retrieve Image from MySQL Database using PHP

AngularJS Store and Retrieve Image from MySQL Database using PHP

In this Post We Will Explain About is AngularJS Store and Retrieve Image from MySQL Database using PHP With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Angular Multiple File Upload with PHP and MySQL Example

In this post we will show you Best way to implement AngularJS Upload Image to Database and Server using HTML,PHP and MySQL, hear for Insert Image Into Database and folder in AngularJS, PHP, MYSQL with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Also Read :   VueJs Autocomplete using Laravel Example


AngularJS with PHP- upload and display image using FileReader with Save in folder example

<!DOCTYPE html>
  <title>AngularJS PHP Angularjs upload and display image in FileReader with Demo and Example</title>
  <script src=""></script>
   <script type="text/javascript">
        var liveApp =  angular.module('liveApp',[]);
        liveApp.service('studentPicUpload', ['$http', function ($http) {
            this.uploadFiletoServer = function(file, uploadUrl){
                 var fildatd = new FormData();
                 fildatd.append('file', file);
                 $, fildatd, {
                     transformRequest: angular.identity,
                     headers: {'Content-Type': undefined,'Process-Data': false}
                    alert("generate Error");
    liveApp.controller('live24Ctrl',  ['$scope', 'studentPicUpload', function($scope, studentPicUpload){
          $scope.studentPicUpload = function() {
              $scope.lvFilepic = $scope.files[0];
             var file = $scope.lvFilepic; 
            var url = "do_insert_upload.php";
            studentPicUpload.uploadFiletoServer(file, url);
     $scope.uploadedFile = function(element) {
            var reader = new FileReader();
            reader.onload = function(event) {
             $scope.$apply(function($scope) {
                $scope.files = element.files;
                 $scope.src =  
<body ng-app="liveApp" ng-controller="live24Ctrl">
    <input type="file" ng-model="lvFilepic" class="form-control"  onchange="angular.element(this).scope().uploadedFile(this)">
    <button ng-click = "studentPicUpload()">upload Image</button>



Also Read :   PHP Get Dropdown list of all Timezones

		$liveext = pathinfo($_FILES['file']['name'],PATHINFO_EXTENSION);
		$image = time().'.'.$liveext;
		move_uploaded_file($_FILES["file"]["tmp_name"], 'images/media/'.$image);
		mysqli_query($db_conn,"INSERT INTO student_mst(profile_pic) VALUES('$image')");
	    echo "Your Profile pic successfully uploaded";


From the above(insert-image-to-db-using-angularjs) source code, variable database db_conn is used for mysql with PHP database connection. From there the live24u is the databasename

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example


I hope you have Got What is Angularjs upload an image and store in database using php And how it works.I would Like to have FeedBack From My Blog( readers.Your Valuable FeedBack,Any Question,or any Comments about This Article( Are Most Always Welcome.