Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

161
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!