minio / minio-js

MinIO Client SDK for Javascript
https://docs.min.io/docs/javascript-client-quickstart-guide.html
Apache License 2.0
920 stars 271 forks source link

uri escape to comply with s3 #1280

Closed prakashsvmx closed 4 months ago

prakashsvmx commented 4 months ago

uriEscape to comply with s3. S3 percent-encodes some extra non-standard characters in a URI . So comply with S3.


//get stream

 try {
        //const result = await s3Client.putObject('test-bucket', `/sa-test-ba/KYC/楽天モバイル法人契約端末購入証明書_[21213213]_[20231113]_[BCDE ddnsf3 litelite 手帳型ケース シンプル ネイビー2])].pdf`,fileStream, stat.size )
        const result = await s3Client.putObject('test-bucket', `rfc3986/rfc3986-filename_test (123)äöü 🥳.txt`,fileStream, stat.size )
      } catch (err) {
        console.log("Error putObject ",  err.message, )
      }

const getPresignedUrl = async function(){

  const getUrl = await s3Client.presignedGetObject("test-bucket", `rfc3986/rfc3986-filename_test (123)äöü 🥳.txt`)
  console.log(getUrl)
}
getPresignedUrl()