【NestJS】GCSに画像をアップロードするとPayloadTooLargeError: request entity too largeで弾かれたので解決した件
概要
サイズの大きい画像を送信するとPayloadTooLargeError: request entity too large
エラーーが発生したので解決方法をまとめる
解決方法
bodyParser
を利用してリクエストバッファサイズを上げることが必要だったみたい
src/main.ts
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
logger: loggerFactory.useFactory('warn'),
})
const logger = app.get<CustomLogger>(CustomLogger)
+ app.use(bodyParser.json({ limit: '32mb' }))
+ app.use(bodyParser.urlencoded({ limit: '32mb', extended: true }))
});
Author And Source
この問題について(【NestJS】GCSに画像をアップロードするとPayloadTooLargeError: request entity too largeで弾かれたので解決した件), 我々は、より多くの情報をここで見つけました https://qiita.com/naoki-haba/items/b1b8a1817ff3dacdefc5著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .