#@fastify/multipart
1 messages Β· Page 1 of 1 (latest)
is Content-Type being set?
// process a single file
// also, consider that if you allow to upload multiple files
// you must consume all files otherwise the promise will never fulfill
const data = await req.file()
it looks like you're sending 2 files, correct?
@sand locust
One file.
I've never used that app so idk, it might be caused by the same thing though
try it if you haven't
yes
I think it's the same problem
The fastify page doesn't distinguish between files and just text
@sand locust try
https://github.com/fastify/fastify-multipart#handle-multiple-file-streams-and-fields
Nothing
req.parts returns {}
go stream in vocal π
Im don`t speak english :(
ok okk
good
show me test
try files()
okey show me your insomnia config and slow π move haha its hard to follow
This?
Ok
ok
try to do this
@sand locust
also use
bun --watch yourfile.ts
to not rerun server each time
it should be in your package.json
u dont need to stop server and run it i think
so yeah
yes , sorry
file type is not allowed
yeah.
I tried open issue in @fastify/multipart
can you try to create a test file
test.ts
const fastify = require('fastify')()
fastify.register(require('@fastify/multipart'))
fastify.post('/upload', async function (req, reply) {
const data = await req.file()
console.log(data)
reply.send()
})
fastify.listen({ port: 3000 }, err => {
if (err) throw err
console.log(`server listening on ${fastify.server.address().port}`)
})
and run it
try with node run
its worked.
yeah weird
very
dont use then fastify π
Sad
try another package or bun native http api
Ok thanks.
π ywlc