1
votes

I'm uploading a PDF using Mirth Connect. I've set the destination to a HTTP sender. The Content type is multipart/formdata and the body is just $(message.rawData).

I'm using a debugger and I can see the request successfully coming in. However the $_FILES array is structured like this:

{
  "e00ce2d3-9bc4-4ce4-a923-2f5aecb1e5fc7756866505906950154_tmp": {
    "name": "e00ce2d3-9bc4-4ce4-a923-2f5aecb1e5fc7756866505906950154.tmp",
    "type": "multipart/form-data",
    "tmp_name": "/tmp/phpJhm8Bf",
    "error": 0,
    "size": 32840
  }
}

My problem is that I would like to use the original file name as the key for the $_FILES array. Is this possible using Mirth, or maybe is that name an encoded version of the original?

I know there are ways around this, I could add the original name as query parameter, but just out of curiosity I would like to know if it's possible to change the name of the key of the file upload.

1
did you get a solution for this? I run into some file uploading issues that fail silently. i'd like to know how you debug it other than plain log.info(...)Denis Wang
Sorry @DenisWang I don't think I found a solution for this, and don't work with Mirth anymoremickadoo

1 Answers

0
votes

If you're using File connector, then you can use the "originalFilename" source map variable. you can just reference it like this:

${originalFilename}