mardi 21 février 2017

How to send the file is POST request in Ember ? Now only the filename is being sent

triggerUpload: function() {
  Ember.$.ajax({
    url: '/api/upload_file', 
    type: 'POST',
    data: this.get('uploadedFile'),
    processData: false,
    contentType: false,
  });
};

<button class="btn btn-success" >Upload</button>

This is what I am doing and it sends the file path in the ajax call rather than the file which I want to send to the backend. Am I missing something? Can't I directly send the file through an api ? Want to send a doc file to the backend for processing and saving.




Aucun commentaire:

Enregistrer un commentaire