Mirth: Send file like PDF, zip or Transfer pdf files using mirth

你。 提交于 2019-12-05 02:58:10

问题


I want to transfer pdf/zip file through mirh.

I am using file reader connector as source and file writer as destination connector.

can any one help me how to send/transfer pdf/zip file?


回答1:


  • Set Incoming data: Delimited text
  • File type: Binary
  • Outgoing filetype also has to be Binary, otherwise the data are corrupted.
  • Outgoing template has to be ${message.rawData}

see screen shot for more info.

Channel settings [summary]

Channel settings [Source]

Channel settings [Destination]




回答2:


var source = "D:/ftproot/PDF/Source";
var fileName = $('fieldId')+".pdf";
var srcpath=source +"\\"+ fileName
var directory = "D:/ftproot/PDF/Target" 
var outFileName = $('fieldId')+".pdf";
var destination = directory +"/" + outFileName

importPackage(java.io);
importPackage(org.apache.commons.io);
//var file = new java.io.File(directory);
var inputFile = new File(srcpath);
var outputFile = new File(destination);
FileUtils.copyFile(inputFile,outputFile);

For Transfer your PDF file from one location to another location .You don't need to bother about that.

Place the above code in your Destination trasfarmer .

The above code will pic the PDF file D:/ftproot/PDF/Source from this path and copied the PDF file in to the another mentioned location i.e D:/ftproot/PDF/Target .You can directly read the file in Mirth using

importPackage(java.io);
importPackage(org.apache.commons.io);

Copy the PDF file using

FileUtils.copyFile(inputFile,outputFile);


来源:https://stackoverflow.com/questions/19922858/mirth-send-file-like-pdf-zip-or-transfer-pdf-files-using-mirth

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!