hiru007
hiru007

Reputation: 133

How to pass buffer/binary file to Bull Queue in NestJS/Node?

I want to pass buffer of a file uploaded (which can be large - 100MB) which i input as form data to Bull Queue, but bull Queue doesnt accept binary or buffer.

How can I pass it?

I can change multer destination to /tmp and try to read from that location in Bull Queue Task Processor, but /tmp files might be deleted before processing

Upvotes: 0

Views: 199

Answers (1)

jampzs
jampzs

Reputation: 39

You can encode the buffer to base64 and decode it back to buffer in your service etc. (This is only recommended if your buffers are small). Large files should be stored in persistent storages like S3.

Check this issue for more

Upvotes: 0

Related Questions