How to Upload file in a directory to minIO bucket

umer

Hello everyone i have bucket in minio server and bucket name is 'geoxing' and geoxing have directory img/site. i want to upload picture in site directry using nodejs. below is code and i am getting error Invalid bucket name: geoxing/img/site. how can i solve this error. thanks

savefile() {
    const filePath = 'D://repositories//uploads//geoxing//site//b57e46b4bcf879839b7074782sitePic.jpg';
const bucketname = 'geoxing/img/site'
    var metaData = {
      'Content-Type': 'image/jpg',
      'Content-Language': 123,
      'X-Amz-Meta-Testing': 1234,
      example: 5678,
    };
    this.minioClient.fPutObject(
      bucketname,
      'b57e46b4bcf879839b7074782sitePic.jpg',
      filePath,
      metaData,
      function (err, objInfo) {
        if (err) {
          return console.log(err);
        }
        return console.log('Success', objInfo.etag);
      },
    );
  }
John Rotenstein

In Amazon S3 and Minio:

  • Bucket should just be the name of the bucket (eg geoxing)
  • Key should include the full path as well as the filename (eg img/site/b57e46b4bcf879839b7074782sitePic.jpg)

Amazon S3 and Minio do not have 'folders' or 'directories' but they emulate directories by including the path name in the Key. Folders do not need to be created prior to uploading to a folder -- they just magically appear when files are stored in that 'path'.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to upload a directory to Minio using Python

How to upload a file to directory in S3 bucket using boto

How to upload a file to directory in S3 bucket using boto

How to upload byte[] to Minio

Upload File to Google Cloud Storage Bucket Sub Directory using Python

How to upload new file into GCP bucket?

How to upload file in relative directory

How to upload a thumbnail file to a amazon s3 bucket?

How to upload file to amazon s3 bucket using axios?

How to upload generate pdf file in controller to S3 bucket

How to upload a file to AWS S3 Bucket?

How to upload a png file to S3 Bucket?

How to upload file to google cloud bucket using signedUrl

How to upload in-memory zip file to S3-bucket

Minio: How's bucket policy related to anonymous/authorized access?

How to upload file into target directory with curl?

How to upload file in any directory with PHP

How to specify upload directory in multer-S3 for AWS-S3 bucket?

website upload file to directory

How to restrict S3 file upload to a bucket by certain file type?

upload file to a folder in gcs bucket using python

Upload file into aws bucket s3

How to get directory of hosting environment .net core 2 to upload file

How do I use gdrive to upload a file to a Google Drive directory?

How do you specify file upload directory for express within sails?

How can I safely upload a large file from the browser to a bucket on Amazon S3?

How to upload a file to an s3 bucket with a custom resource in aws cdk

How to upload file into Wasabi bucket with s3 api with node.js?

How to upload a file from a Docker container that runs on Fargate to S3 bucket?