mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
@@ -33,7 +33,7 @@ const multipartHandler = asyncHandler(async (req, res, next) => {
|
||||
*/
|
||||
|
||||
let disk: string = toArray(env.STORAGE_LOCATIONS)[0];
|
||||
const payload: Partial<File> = {};
|
||||
let payload: Partial<File> = {};
|
||||
let fileCount = 0;
|
||||
|
||||
busboy.on('field', (fieldname: keyof File, val) => {
|
||||
@@ -70,6 +70,9 @@ const multipartHandler = asyncHandler(async (req, res, next) => {
|
||||
storage: payload.storage || disk,
|
||||
};
|
||||
|
||||
// Clear the payload for the next to-be-uploaded file
|
||||
payload = {};
|
||||
|
||||
try {
|
||||
const primaryKey = await service.uploadOne(fileStream, payloadWithRequiredFields, existingPrimaryKey);
|
||||
savedFiles.push(primaryKey);
|
||||
|
||||
Reference in New Issue
Block a user