title: Laravel 5: The server responded with a status of 405 (Method Not Allowed)
body: <p>I am trying to upload a file via ajax, but it throws this message: "<em>The server responded with a status of 405 (Method Not Allowed)</em>" The route is defined like this: <code>Route::post('/file/upload', 'Upload@importFile');</code>  And the Ajax code I'm using is this:</p>
  
  <pre><code>var upload_file=function(input_file,format){
              var formData = new FormData();
              formData.append("upload_file",input_file);
             // formData.append("format",format);
              return $.ajax({
                  type: 'POST',
                  dataType: 'json',
                  processData: false,
                  contentType:  false,
                  data: formData,
                  cache:false,
                  url: '/file/upload/'
              });
          }
  </code></pre>
  
  <p>Somehow it works locally, but it throws this error when I try it on the server, however I've used this same code before and it's worked fine</p>