可下载链接到Strapi媒体文件

发布于 2025-02-05 09:46:40 字数 257 浏览 2 评论 0 原文

我有一个场景,我需要从 媒体库中下载文件时,单击我的客户端端(next.js app)。我一直在为文件上传到 strapi 媒体库的文件寻找可下载的链接

有什么办法可以将可下载的链接转到 strapi 媒体库中的文件。请在这里帮我。

I have a scenario where I need to download a file from Strapi media library when a button is clicked on my client side (Next.js App). I have been looking for a downloadable link for the file which I upload to the Strapi media library.

Is there any way I can get the downloadable link to the files in the Strapi media library. Please help me out here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

汹涌人海 2025-02-12 09:46:40

您必须执行: get /api/crats?

在您的终点中, -docs/api/rest/populate-select“ rel =“ nofollow noreferrer”> https://docs.strapi.io/dev-docs/api/rest/populate/populate-select

In your endpoint you have to do: GET /api/articles?populate=*

See docs: https://docs.strapi.io/dev-docs/api/rest/populate-select

流云如水 2025-02-12 09:46:40

/api/upload

GET /api/upload/files Get a list of files
GET /api/upload/files/:id Get a specific file

需要在设置中设置“查找”权限,并在设置中进行罚款 - >用户&权限插件 - >角色 - >上传

您可以检索上载文件的URL:

”在此处输入图像说明”

/api/upload

GET /api/upload/files Get a list of files
GET /api/upload/files/:id Get a specific file

Need to set permissions for find and fineOne in settings -> Users & Permissions plugin -> Role -> Upload

You could retrieve the url of the uploaded file:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文