Skip to content

Conversation

willnewii
Copy link
Contributor

在小于100kb(大概值)的文件上传中,rsStream 的 ‘data’和‘end’会先后触发. 导致mkfileReq方法中finishedCtxList为空,上传文件失败.
添加了一个标记位,如果文件已经读取结束.直接在mkblkReq的callback调用mkfileReq.

在小于100kb(大概值)的文件上传中,rsStream 的 ‘data’和‘end’会先后触发. 导致mkfileReq方法中finishedCtxList为空,上传文件失败.
添加了一个标记位,如果文件已经读取结束.直接在mkblkReq的callback调用mkfileReq.
@jemygraw
Copy link
Contributor

这个情况你clone新的代码看看,因为之前是rsStream.resume的位置不对导致的。

@willnewii
Copy link
Contributor Author

willnewii commented Aug 23, 2017

7.0.7吗? 应该没有fix. 上传15kb的文件,还是报 ‘unexpected file size’ . @jemygraw 原因应该这个

createReadStream 默认读取的流大小是64KB. getZoneInfo又是个异步方法.导致在putReq方法里,其实文件已经读取结束.'data','end'两个事件会先后触发.这时候 rsStream.pause,rsStream.resume,并没有起效果.

@jemygraw
Copy link
Contributor

jemygraw commented Aug 23, 2017

7.0.7,我可以上传12Byte的文件而没有错误,就是用分片上传的方式。我试过22kb的也没有问题。

@willnewii
Copy link
Contributor Author

@jemygraw 用你们的example 上传就没问题,放我项目(electron)里就跪了... 我再试试~ 谢啦~

@willnewii willnewii closed this Aug 23, 2017
@willnewii
Copy link
Contributor Author

找到问题了.
resume_upload_simple_js_-my-project2-___downloads_web_vue_my-project2
你们把 example/resume_upload_simple.js 文件里 16行注释掉,就能复现我的问题了.
我之前说的也能解释了. 🤣

@willnewii willnewii reopened this Aug 23, 2017
@jemygraw
Copy link
Contributor

可以加个qq聊下么?715429766

@willnewii
Copy link
Contributor Author

加你了哈~

@jemygraw jemygraw merged commit 31c8723 into qiniu:master Aug 28, 2017
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

Successfully merging this pull request may close these issues.

2 participants