Missing fields in request to upload files to minio using the generated presigned url
12:00 09 Apr 2022

I'm using Minio Server to handle files in my nodejs API, basically to emulate s3 locally. I generated Presigned Url to upload images directly.

Presign Url Generation works fine but when I upload my file from Postman the file it gives me this error:



    MissingFields
    Missing fields in request.
    records/marbles.jpg
    bucket
    /bucket/records/marbles.jpg
    16E442AB40F8A81F
    0149bd16-e056-4def-ba82-2e91346c807c
  

The request seems to contain the required headers as mentioned in this thread:

enter image description here

the headers are:

enter image description here

and I also select the file properly in postman(Body>binary>select file) :

enter image description here

The code I use for presigned url generation is:

import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
const s3Client = new S3Client({
    region: 'us-east-1',
    credentials: {
        accessKeyId: 'minioadmin',
        secretAccessKey: 'minioadmin',
    },
    endpoint: 'http://172.21.0.2:9000',
    forcePathStyle: true,
});
  
const bucketParams = {
    Bucket: 'myBucket',
    Key: `marbles.jpg`,
};  
  
const command = new PutObjectCommand(bucketParams);

const signedUrl = await getSignedUrl(s3Client, command, {
    expiresIn: 10000,
})
node.js amazon-s3 minio