Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amis文件分块上传用法,希望提供更详细的使用demo #10205

Closed
Kandde opened this issue May 10, 2024 · 10 comments
Closed

Amis文件分块上传用法,希望提供更详细的使用demo #10205

Kandde opened this issue May 10, 2024 · 10 comments

Comments

@Kandde
Copy link

Kandde commented May 10, 2024

实现场景:

想要做游戏安装包的批量上传,每个游戏安装包大概2G

存在的问题:

https://baidu.github.io/amis/zh-CN/components/form/input-file#%E5%88%86%E5%9D%97%E4%B8%8A%E4%BC%A0

帮助文档中,对于分块上传的三个接口不太清晰,这里是要求用户自己编写接口,以及三个接口数据的拼接,都是用户自己实现么

startChunkApi 用来做分块前的准备工作
chunkApi 用来接收每个分块上传
finishChunkApi 用来收尾分块上传

@2betop
Copy link
Collaborator

2betop commented May 10, 2024

amis 里面没有对应后端接口实现,爱速搭平台内部有实现,能对接各种对象存储。

自己写接口请参考代码处的参数传递

https://github.com/baidu/amis/blob/master/packages/amis/src/renderers/Form/InputFile.tsx#L1076-L1230

@Kandde
Copy link
Author

Kandde commented May 10, 2024

  1. 如果前端用的amis对接,需要自己编写后端接口,根据你提供的代码进行参数传递
  2. 如果当前使用的amis平台,可以某个页面单独对接爱速搭吗

@2betop
Copy link
Collaborator

2betop commented May 10, 2024

amis 平台也有实现,可以对接 bos,群组配置里面有上传配置相关

@Kandde
Copy link
Author

Kandde commented May 10, 2024

您第一个回复里“amis 里面没有对应后端接口实现”, 第二个回复里“amis 平台也有实现”;
第二个回复的意思,是我们不需要自己写后端接口,相应的后端接口可以直接对接bos么,如果可以直接对接bos,是否有可参考的demo呢

@2betop
Copy link
Collaborator

2betop commented May 10, 2024

我以为你说的是厂内 amis 平台,如果是 amis 渲染器,没有对接的 demo

@Kandde
Copy link
Author

Kandde commented May 10, 2024

我说的就是厂内的amis平台呀, 看的这个文档:https://baidu.github.io/amis/zh-CN/components/form/input-file#%E5%88%86%E5%9D%97%E4%B8%8A%E4%BC%A0

@2betop
Copy link
Collaborator

2betop commented May 10, 2024

如果是厂内 amis 平台,不需要实现那三个接口,直接在群组系统配置里面填写 bos 信息即可

@Kandde
Copy link
Author

Kandde commented May 10, 2024

大文件也可以直接上传么,那我试一下

@Kandde
Copy link
Author

Kandde commented May 11, 2024

请问在“上传相关-局部设置”里面,如果是大文件上传,想使用局部设置,应该在代码里如何配置
image

我尝试这样配置,但是finishChunk失败,不知道如何配置,麻烦指点下,谢谢~
image

报错信息:
image

这是请求参数,请求参数里的key是全局配置里面的存储路径,不知道怎样可以使用局部配置的存储路径
image

@Kandde
Copy link
Author

Kandde commented May 11, 2024

问题已解决,正确的配置方式为:
image

@Kandde Kandde closed this as completed May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants