title: Getting cannot POST error
body: <p>I am trying to an existing collection with a set of fields.</p>
  
  <ol>
  <li>I am saving data to one collection.</li>
  <li>Later I want to update the collection with image data, so I tried to update existing collection.</li>
  </ol>
  
  <p>But I am getting the below exception on the <em>Angular Controller side</em>:</p>
  
  <pre><code>Possibly unhandled rejection: {
      "data":"&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n&lt;meta charset=\"utf-8\"&gt;\n&lt;title&gt;Error&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n&lt;pre&gt;Cannot POST /image/upload&lt;/pre&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n",
      "status":404,
      "config":{
          "method":"POST",
          "transformResponse":[null],
          "jsonpCallbackParam":"callback",
          "url":"/image/upload",
          "headers":{"Accept":"application/json, text/plain, */*"},
          "data":{
              "model":{"title":"hello"},
              "files":[{}]
          }
      },
      "statusText":"Not Found"
  }
  </code></pre>
  
  <p><strong>Angular code:</strong></p>
  
  <pre><code>$http({
    method: 'PUT',
    url: properties.imageUpload,
    headers: { 'Content-Type': undefined },
    transformRequest: function(data) {
      var formData = new FormData();
      formData.append("proId", $scope.pid);
      formData.append('model', angular.toJson(data.model));
      for (var i = 0; i &lt; data.files.length; i++) {
        formData.append('file', data.files[i]);
        $scope.uploadedFiles.push(data.files[i]);
      }
      console.log('Sending File size :' + data.files.length);
      //formData.append('file', data.files[0]);
      return formData;
    },
    data: { model: { title: 'hello' }, files: $scope.files }
  
  }).then(function(res) {
    $scope.selectedFiles = "/public/images/" + res.data.imagePaths[0];
    //      console.log(res.data.imagePaths[0]);
  });
  </code></pre>
  
  <p><br/>
  <br/>
  <strong>Angular controller code:</strong> Below I am calling <code>PUT</code> API inside <code>POST</code> API in order to update the existing collection.<br/></p>
  
  <pre><code>$scope.addProducts = function () {
            var product = $scope.product;
            $http.post('/products/create', $scope.product).then(function (res) {
              console.log(res.data._id);
              $scope.upload(res.data._id);//this contains put request.
            });
          }
  </code></pre>
  
  <p>Please help.</p>