Closed xdxddxd closed 4 months ago
is there an issue @xdxddxd ?
is there an issue @xdxddxd ?
Yes, I'm trying to get a pre-signed url but it's giving me this problem, I'm using Minio's npm package, I configured it the way it's described in the documentation and it keeps giving me this error, is there another way to connect with Minio?
i am running similar one locally . It works as expected. So double check credentials, endpoint , port and network connectivity.
var Minio = require('minio')
var minioClient = new Minio.Client({
endPoint: 'localhost',
port: 22000,
useSSL: false,
accessKey: 'minio',
secretKey: 'minio123'
});
async function generatePresignedUrl(bucketName, objectName) {
console.log('➡ Generating presigned URL for object:', objectName);
const url = await minioClient.presignedPutObject(bucketName, objectName);
console.log(`Presigned URL for ${bucketName} ${objectName} is:${url}`)
return url;
}
generatePresignedUrl('test-bucket','1.txt')
Result
➜ node api-tests/presinged-url.js
➡ Generating presigned URL for object: 1.txt
Presigned URL for test-bucket 1.txt is:http://localhost:22000/test-bucket/1.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20240404%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240404T123804Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=266a4145172ba18a179807ddf31f986d73c356a75247a15c2dbf6ed14fd2c40f
Code
Response
Console