when i send the req to the nestjs server its reseve the req and i sent the image with the req and i resev the image in interceptore and i make another interceprot to resize the image but this interceptor see the req but cant see the req.file
this is interceptor
import { Observable } from 'rxjs';
import { Request } from 'express';
@Injectable()
export class ResizeImageInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
const ctx = context.switchToHttp();
const req = ctx.getResponse<Request>();
console.log("Request Body:", req);
console.log("Uploaded File:", req.file);
return next.handle();
}
}```
and this controller
``` @Post("/add-brand")
@UseInterceptors(FileInterceptor('image',{storage: memoryStorage(),}),ResizeImageInterceptor)
async addBrand(@Body(ValidationPipe) brandInfo: CreateBrand, @UploadedFile() file: Express.Multer.File){
}```
when i send the req in console print the req and the image appears in req but when i brent the req.file print in console undifiend
New contributor
Kutaiba Alnizaemy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.