I’m using a thread to read a local folder where a customer drops files.
PROTOCOL: fileset-local
In the Inbound tab, I’ve added a TCL proc to: TPS Inbound Data
Shortened code…
run {
keylget args MSGID mh
set msg [msgget $mh]
set pdfFileName “C:\\Temp\\myFile.pdf”
set outputFile [open $pdfFileName a+]
puts $outputFile $msg;flush $outputFile
close $outputFile
lappend dispList “KILL $mh”
}
If this is a text file, I need to make some changes and write to this folder.
I’ve found that the customer sometimes drops PDF files in this folder as well.
I’ve added logic to the TCL proc that if the extension is a PDF, ignore my custom modifications and just write the file as is, however, it’s not converting the data exactly as it reads it.
It seems it’s adding \CR\LF throughout the msg which means I cannot open the PDF from the folder. Get an error that there is something wrong with the msg.
Not sure why this converts the Text data with no issue, but not the PDF.
Any help would be appreciated.
On a side note, is there a way I can set up my inbound thread to only read *.TXT files and ignore PDF or any other files that may get placed there?