Upload without file #732

Open
opened 2017-04-04 07:37:57 +00:00 by thc0309 · 1 comment
thc0309 commented 2017-04-04 07:37:57 +00:00 (Migrated from github.com)

Hi there.
How can i submit without file uploader ?

Hi there. How can i submit without file uploader ?
AmirAliSobhGol commented 2017-04-09 16:06:46 +00:00 (Migrated from github.com)

you are not asking the right question, you want to know how to send form-data requests.
here is a code snippet

xhrTransport(data) {
    let xhr = new XMLHttpRequest();
    let formData = new FormData();
    let field;
    for (field in data)
      formData.append(field, data[field])
    xhr.open('POST', API_URL);
    xhr.setRequestHeader('Authorization', localStorage.getItem(TOKEN_NAME));
    xhr.send(formData);
  }
you are not asking the right question, you want to know how to send form-data requests. here is a code snippet ``` xhrTransport(data) { let xhr = new XMLHttpRequest(); let formData = new FormData(); let field; for (field in data) formData.append(field, data[field]) xhr.open('POST', API_URL); xhr.setRequestHeader('Authorization', localStorage.getItem(TOKEN_NAME)); xhr.send(formData); }
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#732