KB Article #73931
&(x_file_name) does not work in the application for pop3 protocol
Customer is polling a POP3 server to retrieve email and extract the attachments. They need to save the attachment on the local disk using as physical file name the name of the attachment.
For this they have set the variable &(x_file_name) in the application MAIL under Received file name.
However this parameter remains null and the transfer fails, because GW is unable to create the file locally.
If the parameter is not used in the application the transfer works but the physical file name will be F#####.
Resolution
This is a normal behaviour.
The reason is the mechanism of "pooling the site" is used in POP3, there isn't "real" file transfer, so that the file name can not be filled until the end of transfer. Using &(x_file_name) in an application or any other object that supports such construct will lead to undefined behaviour.
But it's possible to do what the customer asks by using script of transfer end.
Here the example for Windows (similar for Unix).
En solution de remplacement, il est possible d'utiliser le xpr.bat afin de renomer en fin de transfert le fichier par son x_file_name.
0) Copying file xpr.bat to c:\ for example.
1) Creating decision rule for ongoing POP3 transfert (protocol=POP3 state=E ...) with Execution type
'Batch command' set to battch 'c:\xpr.bat'
2) Enable the decision rule
3) In xpr.bat file:
- in the end of file (before) :end, adding one line
move "%x_dir_path%\%x_file_component%" "c:\receptionPOP3\%x_file_name%"
(of course the line 13 " goto end" has to be disable)