Answers for "reactjs upload zip using fetch"

0

reactjs upload zip using fetch

const fileInput = document.querySelector('#your-file-input') ;
const formData = new FormData();

formData.append('file', fileInput.files[0]);

const options = {
  method: 'POST',
  body: formData,
  // If you add this, upload won't work
  // headers: {
  //   'Content-Type': 'multipart/form-data',
  // }
};

fetch('your-upload-url', options);
Posted by: Guest on October-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language