Add upload path that just returns new URL
This commit is contained in:
@@ -34,6 +34,15 @@ export class FileController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('upload.txt')
|
||||||
|
@UseInterceptors(FileInterceptor('file'))
|
||||||
|
@ApiConsumes('multipart/form-data')
|
||||||
|
@Render('file/upload-result')
|
||||||
|
async handleFileSilentUpload(@UploadedFile() file: Express.Multer.File): Promise<any> {
|
||||||
|
const upload = await this.fileService.handleFileUpload(file);
|
||||||
|
return `https://api.us.dev/file/${upload.key}`
|
||||||
|
}
|
||||||
|
|
||||||
@Post('upload.json')
|
@Post('upload.json')
|
||||||
@UseInterceptors(FileInterceptor('file'))
|
@UseInterceptors(FileInterceptor('file'))
|
||||||
@ApiConsumes('multipart/form-data')
|
@ApiConsumes('multipart/form-data')
|
||||||
|
Reference in New Issue
Block a user