Improve file handling in saveFile method
Added comments to clarify the buffer management in the file save process. This enhances code readability and maintenance.
This commit is contained in:
parent
b028fa653a
commit
30706118a8
@ -89,7 +89,9 @@ export class FilesController {
|
||||
@Post("new")
|
||||
async saveFile(@Req() req: IncomingMessage, @Res() res: Response) {
|
||||
let fileBuffer: Buffer = Buffer.from([]);
|
||||
//On row of a file
|
||||
req.on("data", (chunk: Buffer) => {
|
||||
// Represents a buffer for handling file operations.
|
||||
fileBuffer = Buffer.concat([fileBuffer, chunk]);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user