forwardemail / forwardemail/supertest

Attaching buffer for multipart forms

Open
#458 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.4k
Forks
782
PR merge metrics
No merged PRs in 30d

Description

I'm trying to test file uploads, and it works when having a path to the file. Here, the file is 10MB, and I get the 'file too large' error on the backend server as expected. But if I try using a Buffer instead of the same size 10MB, there's no file too large error. Am I using Buffers in the right way in multipart forms here?

```js
// works
.attach('file', pathToFile)

// doesn't work
.attach('file', Buffer.from('a'.repeat(10000000)))
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.