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

支持超大文件传输 #139

Open
w136111526 opened this issue May 31, 2024 · 3 comments
Open

支持超大文件传输 #139

w136111526 opened this issue May 31, 2024 · 3 comments

Comments

@w136111526
Copy link

请问我想传输超过1个G的文件下载,该怎么修改呢?

@qicosmos
Copy link
Owner

qicosmos commented Jun 1, 2024

分段上传就行了。
通过两个api去实现,一个api是告知文件总长度和文件名等信息;一个是分段上传,参数里带文件名和文件二进制数据,如果没有达到总长度就一直传分段,直到达到总长度才关闭文件。

@w136111526
Copy link
Author

上传已经支持超大文件了,做下载文件时,超过1个G的文件,Server直接抛出异常了,需要改哪个地方?

@qicosmos
Copy link
Owner

qicosmos commented Jun 1, 2024

你是直接把几个G的文件搞到内存发送的吗?这样简单粗暴不好。

有一个MAX_BUF_LEN控制读数据的最大长度,你把它改到足够大就行了。

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