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

162
Visualizações
Upload file using HTTP Put using Axios without wrapping in request body

I'm using axios to send a file over to Digital Ocean Spaces (think S3). I use a presigned URL and the put method to send the file over. The problem is, when the file arrives, the contents are wrapped with header information and some integer at the top and bottom of the request body. I can download the file from Spaces and the downloaded copy has the header text. I want the file to arrive "pure" without any headers.

  1. Are these MIME headers?
  2. How can I send the file over so that it doesn't have that header stuff in it?

I pasted below:

  1. The input I use to grab the file
  2. The function where I use axios to send the file over.
  3. An example of the file after it gets received.
<input type="file" onChange={(e) => setUploadFile(e.target.files)} />
    const dataArray = new FormData();
    dataArray.append("upload", uploadFile[0]);
    axios.put(url, dataArray, {

      }).then((response) => {
        axios.post(`/files/${file_id}/uploaded_to_cloud`).then((response) => {

        }).catch((error) => {

        })
      }).catch((error) => {
        // error response
      });
-----------------------------131213519412411207592735141314
Content-Disposition: form-data; name="upload"; filename="tasks.txt"
Content-Type: text/plain

from config.config import is_async
import json
import uuid
from flask import request
-----------------------------131213519412411207592735141314--
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I don't have an answer to the question, however here's what I did that ended up working.

    const xhr = new XMLHttpRequest();
    xhr.open('PUT', url);
    xhr.send(file);
about 4 years ago · Juan Pablo Isaza Relatório
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