[misc]: Processing files in middleware #928
Labels
area:packages
issue regarding one of the uploadthing packages
backend adapters
✨ enhancement
suggestion or feature request to improve uploadthing
workaround available
solution exists for the issue using existing functionality, although it may not be optimized for DX
I understand that this issue may be closed if it should be filed in another category
My issue
I have this documentUploader route, that gets word,pdf and image files:
Disclaimer: I got to this version using ChatGPT, but the overall idea is from 'Josh Tried Coding' channel https://www.youtube.com/watch?v=7hS9b6n7HrM for image compression optimized for nextjs applications.
The Issue
The problem is that in the middleware I haven't figured out how to work with the buffer itself, only with the FileUploadData class, which provides only the name, size, and type of the file, meaning I can't actually make any modifications or create more files in the middleware.
The Solution
Enable in the core.ts file, where all the routes are handled, an option to work with the files themselves BY REQUEST and not by default, so only if there is a BE file optimizer or handler the developer could process the files by selection.
Use cases
The text was updated successfully, but these errors were encountered: