function makeS3Request(fileUrl, signedRequestUrl, file) {
  return new Promise((resolve, reject) => {
    const xhr = new XMLHttpRequest()

    xhr.onreadystatechange = () => {
      if (xhr.readyState === 4) {
        if (xhr.status === 200) {
          resolve(fileUrl)
        } else {
          reject({
            status: xhr.status,
            statusText: xhr.statusText,
          })
        }
      }
    }

    xhr.open('PUT', signedRequestUrl)
    xhr.send(file)
  })
}
// upload to a presigned s3 url
upload to a presigned s3 url
upload to a presigned s3 url
function makeS3Request(fileUrl, signedRequestUrl, file) {
  return new Promise((resolve, reject) => {
    const xhr = new XMLHttpRequest()
    xhr.onreadystatechange = () => {
      if (xhr.readyState === 4) {
        if (xhr.status === 200) {
          resolve(fileUrl)
        } else {
          reject({
            status: xhr.status,
            statusText: xhr.statusText,
          })
        }
      }
    }
    xhr.open('PUT', signedRequestUrl)
    xhr.send(file)
  })
}
function makeS3Request ( fileUrl , signedRequestUrl , file ) { return new Promise ( ( resolve , reject ) => { const xhr = new XMLHttpRequest ( ) xhr . onreadystatechange = ( ) => { if ( xhr . readyState === 4 ) { if ( xhr . status === 200 ) { resolve ( fileUrl ) } else { reject ( { status : xhr . status , statusText : xhr . statusText , } ) } } } xhr . open ( 'PUT' , signedRequestUrl ) xhr . send ( file ) } ) }
upload to a presigned s3 url
upload to a presigned s3 url