@nestjs/common APIs
- Module
- Injectable
- Controller
- Get
- Post
- Inject
- INestApplication
- Body
- Logger
- ExecutionContext
- DynamicModule
- Param
- UseGuards
- Query
- Provider
- HttpStatus
- ValidationPipe
- Global
- Type
- UnauthorizedException
- HttpException
- CanActivate
- SetMetadata
- Delete
- BadRequestException
- NotFoundException
- Req
- Res
- UseInterceptors
- Catch
- ArgumentsHost
- createParamDecorator
- OnModuleInit
- ExceptionFilter
- Put
- CallHandler
- NestInterceptor
- Request
- HttpCode
- ForbiddenException
- Scope
- ModuleMetadata
- PipeTransform
- OnModuleDestroy
- Patch
- LoggerService
- MiddlewareConsumer
- ArgumentMetadata
- applyDecorators
- RequestMethod
- NestMiddleware
- InternalServerErrorException
- UploadedFile
- UsePipes
- ConflictException
- forwardRef
- ParseIntPipe
- NestModule
- CustomDecorator
- HttpModule
- Optional
- UseFilters
- ClassSerializerInterceptor
- OnApplicationShutdown
- HttpService
- Header
- FactoryProvider
- NotAcceptableException
- Response
- Redirect
- OnApplicationBootstrap
- DefaultValuePipe
- Headers
- flatten
- Render
- ParseArrayPipe
- INestApplicationContext
- INestMicroservice
- ContextType
- ServiceUnavailableException
- mixin
- ParamData
- CacheTTL
- NotImplementedException
- UploadedFiles
- ValidationPipeOptions
- WebSocketAdapter
- ForwardReference
- CacheModule
- ValueProvider
- ValidationError
- ImATeapotException
- Sse
- All
- Next
- ParseBoolPipe
- HttpServer
- IntrospectionResult
- ShutdownSignal
- NestHybridApplicationOptions
- Paramtype
- UnsupportedMediaTypeException
- StreamableFile
- LogLevel
- Ip
- UnprocessableEntityException
- RpcExceptionFilter
- Session
- NestApplicationOptions
- BadGatewayException
- CACHE_MANAGER
- ParseUUIDPipe
Other Related APIs
- @nestjs/common#Controller
- @nestjs/common#Get
- @nestjs/common#Param
- @nestjs/common#Res
- @nestjs/common#Post
- @nestjs/common#Query
- @nestjs/common#UseGuards
- @nestjs/common#UseInterceptors
- @nestjs/common#Body
- @nestjs/common#Request
- @nestjs/common#UseFilters
- @nestjs/common#DefaultValuePipe
- @nestjs/common#ParseArrayPipe
- @nestjs/common#ParseBoolPipe
- @nestjs/swagger#ApiTags
- @nestjs/swagger#ApiOperation
- @nestjs/swagger#ApiQuery
- @nestjs/swagger#ApiConsumes
- @nestjs/platform-express#FilesInterceptor
@nestjs/common#UploadedFiles TypeScript Examples
The following examples show how to use
@nestjs/common#UploadedFiles.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: time-series.controller.ts From aqualink-app with MIT License | 6 votes |
@ApiOperation({ summary: 'Upload time series data' })
@UseGuards(IsSiteAdminGuard)
@Auth(AdminLevel.SiteManager, AdminLevel.SuperAdmin)
@Post('sites/:siteId/site-survey-points/:surveyPointId/upload')
@UseInterceptors(
FilesInterceptor('files', MAX_FILE_COUNT, {
dest: './upload',
fileFilter,
limits: {
fileSize: MAX_FILE_SIZE_MB * 10 ** 6,
},
}),
)
uploadTimeSeriesData(
@Param() surveyPointDataRangeDto: SurveyPointDataRangeDto,
@UploadedFiles() files: Express.Multer.File[],
@Body('sensor') sensor: SourceType,
@Query('failOnWarning', ParseBoolPipe) failOnWarning?: boolean,
) {
return this.timeSeriesService.uploadData(
surveyPointDataRangeDto,
sensor,
files,
failOnWarning,
);
}
Example #2
Source File: images.controller.ts From Phantom with MIT License | 6 votes |
@Post('/me/uploadImage')
@ApiConsumes('multipart/form-data')
@UseInterceptors(FilesInterceptor('file'))
async uploadImage(@UploadedFiles() files, @Request() req) {
return await this.ImagesService.uploadFile(
files[0].originalname,
files[0].mimetype,
files[0].buffer,
);
}