mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-22 13:48:41 +01: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 || [];
|
||||
filePaths.forEach((filePath) => {
|
||||
let trimmedFilePath = filePath.trim();
|
||||
|
||||
if (!path.isAbsolute(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 {
|
||||
form.append(name, value);
|
||||
|
Loading…
Reference in New Issue
Block a user