Closed jabedzaman closed 5 months ago
on the picture tagged for backend the logged object should have the file path which was /je/images copy2.jpg
on client
Thank you for taking the time to submit your report! From the looks of it, this could be better discussed on our Discord. If you haven't already, please join here and send a new post in the # 🐈 nestjs-help forum. Make sure to include a link to this issue, so you don't need to write it all again. We have a large community of helpful members, who will assist you in getting this to work.
Is there an existing issue for this?
Current behavior
I am trying to upload folders from a react frontend with rtk query and react dropzone. I am getting the path of the file on the frontend. On the backend I am using
FilesInterceptor
andUploadedFiles
to get the files, but the file path becomes undefined. I tried to keeppreservePath: true,
but still same issue...Frontend file upload code:
@UseInterceptors( FilesInterceptor('files', 100, { preservePath: true, }), ) putFiles( @AuthUser() user: IUser, @UploadedFiles() files: Array,
) {
console.log({
gotFiles: files[0].path, // this is shown as undefined...
});
// return this.filesService.uploadFiles(files, user.uuid);
return {
message: 'Files uploaded successfully',
};
}
Node.js version
v20.12.2
In which operating systems have you tested?
Other
No response