Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

增加对群文件系统上传 Buffer 的支持 #172

Merged
merged 2 commits into from Jun 14, 2021

Conversation

Steve-xmh
Copy link
Contributor

如题,还支持 Uint8Array 的上传,但为了上传 Buffer 必须指定提供一个文件名称,否则会抛出错误

file = Buffer.from(file);
size = file.length;
md5 = common.md5(file), sha1 = common.sha1(file);
name = name ? String(name) : ("file" + md5.toString("hex"));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里自动提供文件名的话会不会不太妥当?而且自动的名称本身也不是很好看的样子。。。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

相信我这是最佳实践

@takayama-lily takayama-lily merged commit ac23c39 into takayama-lily:master Jun 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants