title: Angular JS sending array of base64 to NodeJs server- Allow-Access-Control-Origin
body: <p>I am trying to send an array of base64 string from my Client Side(AngularJs) to my NodeJs Server.
  I am encountering in a weird situation. whenever I send Object Like this:</p>
  
  <pre><code>{Price: 1000000, LookingFor: "Rent", RoomsNumber: 4, Area: 1000, PropertyType: "Any", Base64:['data:image/jpeg;base64,/9..'] }
  </code></pre>
  
  <p>I Get an error like this:</p>
  
  <pre><code>XMLHttpRequest cannot load http://localhost:8080/estate. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 413.
  </code></pre>
  
  <p>And when I remove the base64 the http request is working. Also when I send only one string of base 64 to server, the server accepts it.</p>
  
  <p>in client side I am using angular $http :</p>
  
  <pre><code>self.PostEstate = function (estate) {
              console.log(serverLocation + 'estate');
              console.log('sending estate', estate);
              $http.post(serverLocation + 'estate', estate)
                  .success(function (data) {
                      console.log('successfully sent estate', data);
                      $rootScope.$broadcast('postEstate', {
                          IsSucceded: true,
                          _id: data
                      })
                  }).error(function (err) {
                      $rootScope.$broadcast('postEstate', {
                          Msg: err,
                          IsSucceded: false
                      })
                  });
          }
  </code></pre>
  
  <p>And in my server I am using simple routing of my app:</p>
  
  <pre><code>app.post('/estate', function (req, res) {
  
      var estate = new Estate({
          Price: req.body.Price,
          LookingFor: req.body.LookingFor,
          RoomsNumber: req.body.RoomsNumber,
          Area: req.body.Area,
          PropertyType: req.body.PropertyType,
          Desc: req.body.Desc,
          photos: []
      });
  
      //Thats mongoose obj
      estate.save(function (err) {
          if (err)
              res.send(err);
  
          res.json({
              _id: estate._id
          });
      });
  });
  </code></pre>
  
  <p>I thinking that the post request is too big,can I remove the limit?
  If not can you suggest another architecture that I can send base64 array to my server?
  Thank you in advance.
  PS Just Mention that I use node 10 with express 4.</p>