strapi在收集类型中上传图像URL
如何将图像URL上传到Strapi Collection类型,我想更新该字段 我尝试了各种上传方法,但没有得到任何结果,有人可以帮忙吗?
How can i upload image URL to Strapi collection types and I want to update the field
I have tried various methods to upload but didn't got the result can anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在strapi上上传图像,首先您必须使用 /上传请求,然后将文件作为请求主体传递。
使用此API的响应作为图像的字段值。
假设,您的产品集合具有称为Image的属性,其数据类型是媒体。
要将图像存储到此属性中,
首先致电 /上传API并将请求主体作为“文件”传递:当您尝试将图像存储在产品中时,请使用此 /uploads api的映像bytes和响应。
在创建产品时,Inside Insim属性使用 /上传API响应。
你已经完成了。
In strapi to upload the image, first you have to use /uploads request and pass file in bytes as an request body.
Use the response of this API as an field value of image.
Suppose, you have products collection which has attribute called image and its datatype is media.
To store image into this attribute,
first call /uploads API and pass request body as "files":image-bytes and response from this /uploads API is used when you try to store image in product.
While creating the product, inside image attribute use /uploads API response.
And you are done.