-
Notifications
You must be signed in to change notification settings - Fork 167
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
Passing a Buffer to .attach #126
Comments
Hello. I think I have the same issue when trying to send with content-type: multipart/form-data. Have you solved the problem? |
I never really got it working. Since I was just writing some demo-level scratch code I wrote the buffer to a temporary file and sent the temp file using |
I hope someone will answer and solve the issue. |
I run into this issue today with a It seems that we have to use an FS Readable stream for this API method. It would be great if we could use a Readable stream for this API! |
It turns out that the Example: form.append(
'my_file',
stream,
{
filename: 'bar.jpg',
contentType: 'image/jpeg',
knownLength: 19806,
},
) See: https:/form-data/form-data#void-append-string-field-mixed-value--mixed-options- |
The following works fine for me:
However the next thing I'd like to do do is send large uploads in chunks. I can divide the file into chunks as Buffer objects but sending the buffer to attach does not seem to work for me:
Yields the folowing error:
What is the correct way to send a raw stream to
.attach()
?The text was updated successfully, but these errors were encountered: