Why does he not respond when uploading large files, while uploading slightly smaller files can respond? Are there any restrictions
The backend I am using is the following code:
app.post("/upload", async (req, res, next)=>{
const busboy = new Busboy({ headers: req.headers });
busboy.on("file", async (field, file, name) => {
console.log(req.body, name)
busboy.on('field', async function(field, val) {
// support folder upload
let base = req.query.id;
const parts = val.split("/");
if (parts.length > 1){
for (let i = 0; i < parts.length - 1; ++i){
const p = parts[i];
const exists = await drive.exists(base + "/" + p);
if (!exists) {
base = await drive.make(base, p, true);
} else {
base = base + "/" + p;
}
}
}
const target = await drive.make(base, name, false, { preventNameCollision: true });
res.send(await drive.info(await drive.write(target, file)));
});
});
req.pipe(busboy);
});
The front-end code is as follows:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>File Manager: Initialization as UI</title>
<!-- Webix Library -->
<script type="text/javascript" src="../../codebase/webix/webix.js"></script>
<link
rel="stylesheet"
type="text/css"
href="../../codebase/webix/webix.css"
/>
<!-- App -->
<script type="text/javascript" src="../../codebase/filemanager.js"></script>
<link
rel="stylesheet"
type="text/css"
href="../../codebase/filemanager.css"
/>
</head>
<body>
<script>
webix.ready(function() {
if (webix.env.mobile) webix.ui.fullScreen();
webix.CustomScroll.init();
webix.ui({
view: "filemanager",
url: "http://localhost:3200/",
});
});
</script>
</body>
</html>