Angularjs CSV Import and Insert Core PHP Mysql

Angularjs CSV Import and Insert Core PHP Mysql

Hi, Today Discussed Angularjs CSV Import and Insert Core PHP Mysql backend database. Frontend Angularjs CSV or other file Upload  get this formdata backend post and insert mysql database follows Code.
Angularjs CSV Import and Insert Core PHP Mysql
Angularjs CSV Import and Insert Core PHP Mysql

Controller.js

$scope.submit1=function(){

  var s = $scope.fileContent;
  var d = JSON.stringify(s);

             var ds = {'unitname':d,'mode':'csv'}
  var d = JSON.stringify(ds);
console.log(d);
    var postUrl = '../app/api/unit.php';
  $http.post(postUrl,d,{
            transformRequest: angular.identity,
            headers: { 'Content-Type': "application/json" }
        }).success(function(data){
       //  console.log(data.type);
              type=data.type,
              title="UnitCreation",
              message=data.response
 toaster.pop(type, title, message);
       
        });


}
CSV File Reader
Directive.js

  
angular.module('MetronicApp').directive('fileReader', function() {
  return {
    scope: {
      fileReader:"="
    },
    link: function(scope, element) {
      $(element).on('change', function(changeEvent) {
        var files = changeEvent.target.files;
        if (files.length) {
          var r = new FileReader();
          r.onload = function(e) {
              var contents = e.target.result;
              scope.$apply(function () {
                scope.fileReader = contents;
                //console.log(scope.fileReader);
               // var s = JSON.stringify(contents)
              // console.log(contents);
              });
          };
          
          r.readAsText(files[0]);

        }

      });
    }
  };
});
View.html

<form role="form" id="form_sample_2" id="container" data-ng-submit="submit1()">
   

     <input type="file" file-reader="fileContent" ng-model="fileContent" class="btn btn-primary" />
    
    <input type="hidden" ng-model="fileContent">
     <button class="btn sbold blue" name="submit" type="submit">Upload</button>

</form>




Angularjs CSV Import and Insert Core PHP Mysql Developerinvention 5 of 5
Angularjs CSV Import and Insert Core PHP Mysql Hi, Today Discussed Angularjs CSV Import and Insert Core PHP Mysql backend database. Fro...

Share this

Related Posts

Previous
Next Post »

52 comments

comments
8 April 2017 at 18:52 delete


Come and read us!! We are moving our blog into a new site with a much more pretentious goal. We are going to teach how to be AngularJS Ninjas!!! That's right! We have taken a couple of weeks to prepare our first workshop, absolutely free!!!!

AngularJS Training in Chennai

Reply
avatar
19 February 2018 at 17:55 delete

I really love reading and following your post as I find them extremely informative and interesting. This post is equally informative as well as interesting Java Training Center in Chennai | Best J2EE Training Center in Chennai | No.1 Java Training Institution in Velachery | Core Java Training in Chennai

Reply
avatar
28 April 2018 at 11:11 delete

Informative blogs.. Thank you for sharing your thoughts...Continue more

Selenium training in Velachery | Selenium training in chennai

Reply
avatar
28 April 2018 at 17:29 delete

Really an amazing post with smart and cute content.thanks for sharing such an informative article..
Best Summer Courses in Nanganallur | No.1 Summer Courses in Nanganallur

Reply
avatar
29 April 2018 at 10:14 delete

Very nice post to keep sharing.. Thanks for giving very nice information from your post.. Java Training in Chennai

Reply
avatar
SRI
6 September 2018 at 17:25 delete

Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.


rpa training in marathahalli


rpa training in btm


rpa training in kalyan nagar


rpa training in electronic city


rpa training in chennai

rpa training in pune

rpa online training

Reply
avatar
18 September 2018 at 12:22 delete

Good job! Fruitful article. I like this very much. It is very useful for my research. It shows your interest in this topic very well. I hope you will post some more information about the software. Please keep sharing!!
Selenium Training in Chennai
Selenium Training
Selenium training in Velachery
Selenium training in Adyar
Selenium training in Tambaram

Reply
avatar
21 September 2018 at 11:54 delete

This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
Python training in usa
Python training in marathahalli
Python training in pune

Reply
avatar
24 September 2018 at 11:09 delete

Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
DevOps online Training
DevOps Training in USA

Reply
avatar
24 September 2018 at 16:31 delete

Nice article. I liked very much. All the informations given by you are really helpful for my research. keep on posting your views.
AWS Solution Architect
Best AWS Training in Bangalore
AWS Training in Perambur
AWS Training in Vadapalani

Reply
avatar
9 October 2018 at 16:46 delete


I’m planning to start my blog soon, but I’m a little lost on everything. Would you suggest starting with a free platform like Word Press or go for a paid option? There are so many choices out there that I’m completely confused. Any suggestions? Thanks a lot.
Best AWS Training in Marathahalli | AWS Training in Marathahalli
Amazon Web Services Training in Anna Nagar, Chennai |Best AWS Training in Anna Nagar, Chennai

Reply
avatar
11 October 2018 at 15:23 delete

This is the best explanation I have seen so far on the web. I was looking for a simple yet informative about this topic finally your site helped me allot.
Selenium Training in Chennai
JAVA Training in Chennai
Big Data Training in Chennai
Hadoop Training in Chennai
iOS Training in Chennai
Selenium Courses in Chennai

Reply
avatar
17 October 2018 at 10:36 delete

Nice idea,keep sharing your ideas with us.i hope this information's will be helpful for the new learners.
Java J2ee Training in Bangalore
Java Courses in Chennai Mogappair
Java Training in T nagar
Java Training in OMR

Reply
avatar
29 October 2018 at 15:10 delete

Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
excel advanced excel training in bangalore | Devops Training in Chennai

Reply
avatar
3 November 2018 at 11:52 delete

Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

Java training in Bangalore | Java training in Btm layout

Java training in Bangalore |Java training in Rajaji nagar

Java training in Bangalore | Java training in Kalyan nagar

Reply
avatar
3 November 2018 at 12:49 delete

This is a good post. This post give truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. thank you so much. Keep up the good works.
Web Designing Course in chennai
PHP Training in Chennai
web designing training in chennai
Web Development courses in Chennai
PHP Course in Chennai
PHP Training Institute in Chennai

Reply
avatar
3 November 2018 at 14:43 delete

Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.


AWS Training in BTM Layout |Best AWS Training in BTM Layout

AWS Training in Marathahalli | Best AWS Training in Marathahalli


Reply
avatar
10 November 2018 at 15:50 delete

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
angularjs Training in bangalore

angularjs Training in bangalore

angularjs Training in chennai

automation anywhere online Training

angularjs interview questions and answers

Reply
avatar
24 November 2018 at 12:12 delete

Nice informative post...Thanks for sharing..

Education
Technology

Reply
avatar
27 November 2018 at 10:44 delete

feeling so good to read your information's in the blog.
thanks for sharing your ideas with us and add more info.
Java Training in Navalur
Java Training in Nungambakkam
Java Courses in Chennai Ambattur
Java Training in Bangalore

Reply
avatar
29 November 2018 at 18:22 delete

The content you post is very useful by using this i can solve my problem.
To know the details about JAVA contact us: Liveiwre Velachery

Reply
avatar
30 November 2018 at 12:28 delete

I accept there are numerous more pleasurable open doors ahead for people that took a gander at your site.we are providing ReactJs training in Chennai.
For more details: ReactJs training in Velachery | ReactJs training in chennai

Reply
avatar
5 December 2018 at 11:56 delete

This is a good post. This post give truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. thank you so much. Keep up the good works.
Best Android Training in Chennai
Android Course in Chennai with placement
Android Training Center in Chennai
Aws Certification in Chennai
Amazon Web Services Training in Chennai
AWS Training centers in Chennai

Reply
avatar
17 January 2019 at 14:12 delete

Tired of boring work? Play and win with BGAOC top online casino come in now and take your winnings.

Reply
avatar
2 March 2019 at 17:05 delete

The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea.
here by i also want to share this.
data science online training
python online training
uipath online training
data science with python online training
rpa online training

Reply
avatar
7 March 2019 at 16:03 delete

Thank you so much for a well written, easy to understand article on this. It can get really confusing when trying to explain it – but you did a great job. Thank you!
angularjs online training

apache spark online training

informatica mdm online training

devops online training

aws online training

Reply
avatar
7 March 2019 at 16:03 delete

I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.is article.

Microsoft Azure online training
Selenium online training
Java online training
Java Script online training
Share Point online training


Reply
avatar

Xolo Offer