如何将图像上传到trapi?

问题描述 投票:0回答:1

如何将图像上传到Strapi服务器?

  • 我使用GraphQL插件。
  • 我希望所有API都使用一个端点

I found an article about how to manage file uploads but I have some questions

我需要将图像转换为Base64字符串吗?

我的生产服务器将是PostgreSQL。我打算将图像存储为Blob。但是现在事实证明,我只能将Form-Data发送到Strapi服务器。

我需要类似apollo-upload-client的东西吗?

Note:当前,我使用vue-apollo和nativescript-vue作为前端。

import VueApollo from "vue-apollo";
import { ApolloClient, InMemoryCache, HttpLink } from "apollo-boost";
import { setContext } from "apollo-link-context";
express graphql koa strapi vue-apollo
1个回答
0
投票

如果您尝试使用GraphQL上传文件,建议您检查此要点-https://gist.github.com/alexandrebodin/fedc71c8513bfbb6283cc90ae62755c5

您应该拥有实现该目标所需的所有信息。

© www.soinside.com 2019 - 2024. All rights reserved.