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

文件上传后,文件大小发生变化 #89

Open
xuejiasong opened this issue Mar 12, 2020 · 2 comments
Open

文件上传后,文件大小发生变化 #89

xuejiasong opened this issue Mar 12, 2020 · 2 comments

Comments

@xuejiasong
Copy link

例如文件本身16M 上传后得到大小是19M 都有一定误差 ,这个有解决办法么

@peinhu
Copy link
Owner

peinhu commented Mar 12, 2020

文件进行过上传前后的哈希校验,实际大小不可能发生改变,你可以上传后下载下来看看是不是原来的大小。
windows和linux系统不太一样,windows中1KB=1024B,linux中1KB=1000B。

@peinhu
Copy link
Owner

peinhu commented Mar 12, 2020

你是看的我那个JS回调里的大小吧?我是按照linux的进制来的,所以用的是1KB=1000B标准,你把里面的1000改成1024应该就和你windows上原来大小一致了,这个没必要纠结,强制哈希校验决定了文件内容和大小都不可能改变。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants