title: Upload mass data to Firebase
body: <p>I am trying to upload my CSV of data to Firebase but its been throwing a strange error. I'm not as familiar with JavaScript as I would like so that might be part of the problem.</p>
  
  <p>This is the data I want to upload:</p>
  
  <pre><code>704,STANDARD,PARC PARQUE,PR,NOT ACCEPTABLE,17.96,-66.22,"Parc Parque, PR"
  704,STANDARD,SECT LANAUSSE,PR,NOT ACCEPTABLE,17.96,-66.22,"Sect Lanausse, PR"
  704,STANDARD,URB EUGENE RICE,PR,NOT ACCEPTABLE,17.96,-66.22,"Urb Eugene Rice, PR"
  704,STANDARD,URB GONZALEZ,PR,NOT ACCEPTABLE,17.96,-66.22,"Urb Gonzalez, PR"
  </code></pre>
  
  <p>I didn't use anything fancy to try to upload the document, this seemed like the quickest way to get everything uploaded in the style I want:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;head&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdn.firebase.com/js/client/2.4.2/firebase.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  $(function () {
      var myFirebaseRef = new Firebase("https://&lt;firebasetag&gt;.firebaseio.com/coordinates");
  
      var onComplete = function(error) {
        if (error) {
          console.log('Synchronization failed: ' + error);
        } else {
          console.log('Synchronization succeeded');
        }
      };
  
      $("#upload").bind("click", function () {
          var regex = /^([a-zA-Z0-9\s_\\.\-:])+(.csv|.txt)$/;
          if (regex.test($("#fileUpload").val().toLowerCase())) {
              if (typeof (FileReader) != "undefined") {
                  var reader = new FileReader();
                  reader.onload = function (e) {
                      var rows = e.target.result.split("\n");
                      for (var i = 0; i &lt; rows.length; i++) {
                          var cells = rows[i].split(",");
                          myFirebaseRef.set({
                              [cells[0]]: {
                                  zipcodetype: cells[1],
                                  city: cells[2],
                                  state: cells[3],
                                  locationtype: cells[4],
                                  latitude: cells[5],
                                  longitude: cells[6],
                                  locationttext: cells[7]
                              }
                          }, onComplete);                    
                      }
                  }
                  reader.readAsText($("#fileUpload")[0].files[0]);
              } else {
                  alert("This browser does not support HTML5.");
              }
          } else {
              alert("Please upload a valid CSV file.");
          }
      });
  });
  &lt;/script&gt;
  &lt;input type="file" id="fileUpload" /&gt;
  &lt;input type="button" id="upload" value="Upload" /&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  
  &lt;html&gt;
  </code></pre>
  
  <p>This is all that shows up in the database:</p>
  
  <p><a href="https://i.stack.imgur.com/gLcr3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gLcr3.png" alt="enter image description here"></a></p>
  
  <p>What it does is upload only one row but "Synchronization succeeded" is always printed in my console.</p>
  
  <p>I want it to upload each row since my original data is about 90,000 lines long. Help?</p>