Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@blazity/nest-file-fastify
Advanced tools
This library adds decorators for Nest.js to support fastify-multipart. The API is very similar to the official Nest.js Express file decorators.
NPM
$ npm install @blazity/nest-file-fastify fastify-multipart
Yarn
$ yarn add @blazity/nest-file-fastify fastify-multipart
import { FileInterceptor, UploadedFile, StorageFile } from '@blazity/nest-file-fastify';
@Post('upload')
@UseInterceptors(FileInterceptor('file'))
uploadFile(@UploadedFile() file: StorageFile) {
console.log(file);
}
FileInterceptor
arguments:
fieldname
: string - name of the field that holds a file
options
: optional object of type UploadOptions
import { FilesInterceptor, UploadedFiles, StorageFile } from '@blazity/nest-file-fastify';
@Post('upload')
@UseInterceptors(FilesInterceptor('files'))
uploadFile(@UploadedFiles() files: StorageFile[]) {
console.log(files);
}
FilesInterceptor
arguments:
fieldname
: string - name of the field that holds files
maxCount
: optional number - maximum number of files to accept
options
: optional object of type UploadOptions
import { FileFieldsInterceptor, UploadedFiles, StorageFile } from '@blazity/nest-file-fastify';
@Post('upload')
@UseInterceptors(FileFieldsInterceptor([
{ name: 'avatar', maxCount: 1 },
{ name: 'background', maxCount: 1 },
]))
uploadFile(@UploadedFiles() files: { avatar?: StorageFile[], background?: StorageFile[] }) {
console.log(files);
}
FileFieldsInterceptor
arguments:
uploadFields
: object of type UploadField
options
: optional object of type UploadOptions
import { AnyFilesInterceptor, UploadedFiles, StorageFile } from '@blazity/nest-file-fastify';
@Post('upload')
@UseInterceptors(AnyFilesInterceptor()
uploadFile(@UploadedFiles() files: StorageFile[]) {
console.log(files);
}
AnyFilesInterceptor
arguments:
options
: optional object of type UploadOptions
FAQs
fastify-multipart decorators for Nest.js
The npm package @blazity/nest-file-fastify receives a total of 8,942 weekly downloads. As such, @blazity/nest-file-fastify popularity was classified as popular.
We found that @blazity/nest-file-fastify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.