I am facing a problem where the content-type always changes during the upload process. I am using lambda and nodejs to generate a URL. Here is my code. I would be grateful for any help!
Asked
Active
Viewed 1,575 times
1

Baksha2008
- 139
- 6
-
1What is the file type of the file in your request object? – Lucasz Sep 06 '21 at 03:16
-
"video/mp4" of course. – Baksha2008 Sep 06 '21 at 05:06
1 Answers
4
Your code for generating the Signed URL works ok. The problem seems to be with the actual uploading of the file. Try these options and let's see if you get a better result:
In postman use the binary option and not the form-data
form-data adds a lot of additional values
Create a nodejs file and test with this code
const axios = require('axios'); const fs = require('fs'); (async () => { const file = fs.readFileSync('./download.mp4'); await axios.put(signedUrl, { data: file, }, { headers: { 'Content-Type': 'video/mp4' } }); })();

Цветан Иванов
- 1,066
- 1
- 8
- 7