Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

163
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda