admin管理员组文章数量:1295927
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);
},
);
}
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);
},
);
}
Share
edited Jul 20, 2022 at 10:39
umer
asked Jul 20, 2022 at 10:34
umerumer
691 gold badge4 silver badges11 bronze badges
2
-
The bucket would be
geoxing
, the key would beimg/site/b57e46b4bcf879839b7074782sitePic.jpg
. – John Rotenstein Commented Jul 20, 2022 at 12:06 - wow, thank you. the problem is solved. – umer Commented Jul 21, 2022 at 1:21
1 Answer
Reset to default 5In 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'.
本文标签: javascriptHow to Upload file in a directory to minIO bucketStack Overflow
版权声明:本文标题:javascript - How to Upload file in a directory to minIO bucket - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741628270a2389206.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论