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

formstream 模块使用buffer模式发送时出现的问题 #3363

Closed
tong3jie opened this issue Jan 6, 2019 · 4 comments
Closed

formstream 模块使用buffer模式发送时出现的问题 #3363

tong3jie opened this issue Jan 6, 2019 · 4 comments

Comments

@tong3jie
Copy link
Contributor

tong3jie commented Jan 6, 2019

formstream 发送发送file时eeg作为服务端使用egg-multipart可正常解析,但是使用buffer时,服务器无法接收,出现超时

服务端抓包,没有看到请求数据包

const formData = require('formstream');
const stream = new formData();
stream.fild('a','b');
stream.file('file1','C:\\1.text')

上面的例子没问题,下面的例子有问题。

const formData = require('formstream');
const stream = new formData();
stream.fild('a','b');
stream.buffer('file1',Buffer.from('123'),'1.txt')

补充一下:httpClient的option的数据类型为

method: 'POST',
headers: formData.headers(),
stream: formData,
dataType: 'json',

如何设置为data:formData,则服务器可以接收数据,但是无法解析出formData的内容

@tong3jie
Copy link
Contributor Author

tong3jie commented Jan 6, 2019

@dead-horse

@tong3jie
Copy link
Contributor Author

tong3jie commented Jan 6, 2019

使用axios一样发不出去消息,非常奇怪。
发普通消息没问题

@egg-bot
Copy link

egg-bot commented Jan 7, 2019

Hello @tong3jie. Please provide a reproducible example following the instruction.

Issues labeled by Need Reproduce will be closed if no activities in 7 days.


@tong3jie,请根据这个说明提供最小可复现代码。

如果在 7 天内没有进展会被自动关闭。

@egg-bot
Copy link

egg-bot commented Jan 15, 2019

This issue is closed because it has been marked as Need Reproduce, but has not had recent activity.
If you can provide a reproduce, feel free to ping anyone of our maintainers to reopen this issue.
Thank you for your contributions.

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

3 participants