Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

91
Visualizações
To Uplode image in s3 bucket from front end

I am using react.js for front-end,I am trying to uplode the Image directly to aws,via geting url from the my server.

const handleSubmit = async (e) => {
e.preventDefault()
// In this get we url from to uplode profile image to s3 bucket ,first get url from server and then use that url to uplode directly to aws
const res = await fetch("/api/website/aws/get-s3-upload-url")   ---url from server to uplode to aws
const data_2 = await res.json()
const profile_url = await data_2.uploadUrl

console.log(`This is profile url ${profile_url}`)

// Now use this url to uplode the image to aws
let form_data = new FormData()
form_data.append("profile_image", profile)

const resp = await fetch(profile_url, {
  method: "PUT",
  headers: {
    "Content-type": "multipart/form-data",
  },
  body: profile,
})
const data_3 = await resp

The response I am getting from aws after uplode is: enter image description here

What I want is key of the object that i can save to my serve,and when require I can fetch the Image. How can I achive this

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda