mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-21 20:41:41 +02:00
Fixed file uploads performance issues (#1562)
This commit is contained in:
parent
808af3c19a
commit
64487ad923
@ -15,11 +15,12 @@ const parseFormData = (datas, collectionPath) => {
|
|||||||
const filePaths = value || [];
|
const filePaths = value || [];
|
||||||
filePaths.forEach((filePath) => {
|
filePaths.forEach((filePath) => {
|
||||||
let trimmedFilePath = filePath.trim();
|
let trimmedFilePath = filePath.trim();
|
||||||
|
|
||||||
if (!path.isAbsolute(trimmedFilePath)) {
|
if (!path.isAbsolute(trimmedFilePath)) {
|
||||||
trimmedFilePath = path.join(collectionPath, trimmedFilePath);
|
trimmedFilePath = path.join(collectionPath, trimmedFilePath);
|
||||||
}
|
}
|
||||||
const file = fs.readFileSync(trimmedFilePath);
|
|
||||||
form.append(name, file, path.basename(trimmedFilePath));
|
form.append(name, fs.createReadStream(trimmedFilePath), path.basename(trimmedFilePath));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
form.append(name, value);
|
form.append(name, value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user