Skip to content

detectNestUpload

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/parser-core/src/openapi/multipart.ts

NestJS: @UseInterceptors(FileInterceptor('avatar')) and friends.

The interceptor argument is the multipart FIELD NAME — get that wrong and the picker uploads under a name the server discards. classDecorators are consulted only when the handler also declares an @UploadedFile(s) parameter: a controller-level interceptor applies to every route in the class, and reading it unconditionally would turn a whole controller multipart.

Signature

ts
function detectNestUpload(methodDecorators: string, params: string, classDecorators): MultipartBody | undefined

Parameters

NameType
methodDecoratorsstring
paramsstring
classDecoratorsany

Returns: MultipartBody | undefined

Was this page helpful?

Download as PDF