I have a bucket called mybucket
in minio and MINO_FOLDER=static
. I connected this to my strapi CMS. When using CMS interface I am able to upload images to folder and get image url like domain/static/web/logo.png
. However when trying to upload to this web
folder using custom strapi Rest API my images are uploaded to static (static/logo.png not static/web/logo.png)
. I tried all possible ways of passing folder and path but none worked. Is it possible to achieve desired result ?
Here is my service function:
I tried passing path
and folder
. And passing mybucker/static/web
…
async add(ctx) {
const { files } = ctx.request;
// const { folder } = ctx.request.body;
if (!files || !files.files) {
return ctx.badRequest("No files uploaded");
}
const uploadedFile = await strapi.plugins["upload"].services.upload.upload({
data: {},
files: files.files,
path: "static/web",
});
return uploadedFile;
},