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 Dev2Tricks 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 »

69 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
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 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
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
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
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
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
12 June 2020 at 19:50 delete

Awesome post with lots of data and I have bookmarked this page for my reference. Share more ideas frequently.
AWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery


Reply
avatar
9 August 2020 at 22:15 delete

Your site is amazing and your blogs are informative and knowledgeable to my websites.This is one of the best tips in my life. I have in quite some time.Nicely written and great info.Thanks to share the more information's.
Salesforce Training in Chennai

Salesforce Online Training in Chennai

Salesforce Training in Bangalore

Salesforce Training in Hyderabad

Salesforce training in ameerpet

Salesforce Training in Pune

Salesforce Online Training

Salesforce Training

Reply
avatar
26 October 2020 at 01:22 delete

While on the other hand, they can even alter your data in unexpected ways, ultimately leading to recovery challenge and data corruption. Salesforce training in Hyderabad

Reply
avatar
14 December 2020 at 15:56 delete

very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.

WHAT IS NATURAL LANGUAGE PROCESSING? INTRO TO NLP

Reply
avatar
20 May 2021 at 23:29 delete

The most real football betting UFABET that is beyond explanation Find fun, excitement and excitement with slot online games, 100 no cost acknowledgement, quick withdrawal. If you desire to relax slots for money No need to put a great deal, with no minimum, with no need to talk about, waste time simply because UFABET is in fact reduced, given heavily, many good promotions are waiting for you. Prepared to guarantee pleasurable, regardless of whether it is Joker SlotXo fruit slot, we are able to telephone call it an internet slot website for yourself particularly. Able to relax Including the assistance staff members which is going to facilitate slot formulas along with methods of actively playing So you can be sure that each moment of excitement and fun We'll be there for you to provide your potential customers the greatest impression but also achievement.
บาคาร่า
ufa
ufabet
แทงบอล
แทงบอล
แทงบอล

Reply
avatar
30 May 2021 at 23:02 delete

ได้โดยที่จะทำให้คุณนั้นสามารถสร้างกำไรจากการเล่นเกมส์เดิมพันออนไลน์ได้เราแนะนำเกมส์ชนิดนี้ให้คุณได้รู้จักก็เพราะว่าเชื่อว่าทุกคนนั้นจะต้องรู้วิธีการเล่นและวิธีการเอาชนะเกมม สล็อต าแทบทุกคนเพราะเราเคยเล่นกันมาตั้งแต่เด็กเด็กหาคุณได้เล่นเกมส์คาสิโนออนไลน์ที่คุณนั้นคุ้นเคยหรือจะเป็นสิ่งที่จะทำให้คุณสามารถที่จะได้กำไรจากการเล่นเกมได้มากกว่าที่คุณไปเล่นเกมส์คาสิโนออนไลน์ที่คุณนั้นไม่เคยเล่นมาก่อนและไม่คุ้นเคย เราจึงคิดว่าเกมส์ชนิดนี้เป็นเกมส์ที่น่าสนใจมากๆที่เราอยากจะมาแนะนำให้ทุกคนได้รู้จักและได้ใช้บริการ

Reply
avatar
29 June 2021 at 09:33 delete

You've made some valid statements there. I looked on the web for extra data about the issue and discovered a great many people will oblige your perspectives on this site.

best interiors

Reply
avatar
24 October 2021 at 18:59 delete

Grab the Digital Marketing Training in Chennai from Infycle Technologies, the best software training institute, and Placement center in Chennai which is providing professional software courses such as Data Science, Artificial Intelligence, Cyber Security, Big Data, Java, Hadoop, Selenium, Android, and iOS Development, DevOps, Oracle, etc with 100% hands-on practical training. Dial 7502633633 to get more info and a free demo and to grab the certification for having a peak rise in your career.

Reply
avatar
7 February 2022 at 19:00 delete

Very Informative blog thank you for sharing. Keep sharing.

Best software training institute in Chennai. Make your career development the best by learning software courses.

best azure training in chennai
android course in chennai
devops training in chennai

Reply
avatar
5 April 2022 at 14:34 delete

Beautiful blog, so many thoughts in one place, thanks for the helpful article, and please keep posting more.
Digital marketing courses in Bangalore
Digital marketing courses in Chennai

Reply
avatar
26 September 2022 at 12:51 delete

Click on black button To Start Download Edius Pro 9.3. Setup Link. Password: MalikMovieStudio. Windows Update Link. Loader Link. Crack Link. Edius 9 free download full version with crack

Reply
avatar
26 September 2022 at 14:05 delete

Download latest Synthesia 10.5.1 full version cracked edition for free, Synthesia crack + serial key generator & patch.Synthesia Unlock Key

Reply
avatar
26 September 2022 at 15:05 delete

Even after enduring the ups and downs of life, our marriage is still strong. My dear, congratulations on finishing 10 years of our marriage” . Anniversary Words For Wife

Reply
avatar
15 June 2023 at 17:25 delete

Nice article. I liked very much. All the informations given by you are really helpful for my research. keep on posting your views.

IELTS Coaching in Chennai

Reply
avatar
15 June 2023 at 17:26 delete This comment has been removed by the author.
avatar
Anonymous
26 June 2023 at 17:29 delete

Reading your blog taught me something new, and I appreciate you sharing it with us. Wonderful to read your Article.

IELTS Coaching in Bangalore

Reply
avatar
Rupesh kumar
29 August 2023 at 12:07 delete

I found so many interesting stuff in your blog especially its discussion. Looking for the best way to enhance your spoken English skills in Kuwait? Look no further than Ziyyara Edutech's exceptional online spoken English classes.
For more info visit Spoken English classes in Kuwait

Reply
avatar
9 November 2023 at 12:26 delete

I would like to thank you for the wonderful information. Amazing post!. Join the best online English language courses, embark on a journey to fluency, and watch your language skills soar with us!
Book a free demo today. Best online english language courses in bahrain

Reply
avatar