diff --git a/packages/bruno-app/src/utils/importers/postman-collection.js b/packages/bruno-app/src/utils/importers/postman-collection.js index e34530a19..dc291dbdb 100644 --- a/packages/bruno-app/src/utils/importers/postman-collection.js +++ b/packages/bruno-app/src/utils/importers/postman-collection.js @@ -180,12 +180,27 @@ const importPostmanV2CollectionItem = (brunoParent, item, parentAuth, options) = if (bodyMode) { if (bodyMode === 'formdata') { brunoRequestItem.request.body.mode = 'multipartForm'; + each(i.request.body.formdata, (param) => { + const isFile = param.type === 'file'; + let value; + let type; + + if (isFile) { + // If param.src is an array, keep it as it is. + // If param.src is a string, convert it into an array with a single element. + value = Array.isArray(param.src) ? param.src : typeof param.src === 'string' ? [param.src] : null; + type = 'file'; + } else { + value = param.value; + type = 'text'; + } + brunoRequestItem.request.body.multipartForm.push({ uid: uuid(), - type: 'text', + type: type, name: param.key, - value: param.value, + value: value, description: param.description, enabled: !param.disabled });