Skip to Content
0

Extension .txt adding to source file while archiving

Aug 03, 2017 at 04:22 PM

139

avatar image
Former Member

Hi Experts,

My scenario is SFTP to SFTP Pass-through.

when the source file is archived to specified folder it is saving as "<entirefilename.csv>.txt",adding an extension .txt to the original .csv/.pdf files.

EX:- TEST_XXXXX.csv.txt
TEST_XXXXX.pdf.txt

Please help me on this to resolve.

Regards,

Ham

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Evgeniy Kolmakov Aug 18, 2017 at 02:30 PM
0

Also there is another note:

1815655 - Default extension added while archiving files on SFTP server

Symptom

SFTP Adapter is being used in the business scenario for message processing. At the sender side, the flag "Archive Files on SFTP Server" is checked and the field "Archive name" is configured to archive the files on SFTP Server. During message processing, it is noticed, that, files are being archived in the archive directory with an undesired extension.

Other Terms

SFTP adapter, SFTP, Archive Files on on SFTP Server, Archive name, adapter, Archive, Source Files, sender

Reason and Prerequisites

Program error

Solution

This issue has been resolved by code correction.

Also, an advanced mode parameter "addDefaultFileExtension" has been introduced. If this parameter is set to 'true', then, while archiving the files on SFTP server, the additional check will be performed to check whether the file has ".txt" extension or not. If not, then the ".txt" extension will be added with the file name. Else, normal execution continues i.e. files will be archived on the SFTP server with their original name.

The default value for the parameter "addDefaultFileExtension" is 'false'.

To get this correction available in your Support package you need to apply the patch matching to your support package version as per the instructions in the NetWeaver Support Package Stack guide which can be found on the SAP Service Marketplace as described in SAP Note 952402.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Aug 18, 2017 at 02:25 PM
0

Hi Ham!

Acoording to SAP Note 1817747:

Symptom

At the sender side of SFTP Adapter, the flag "Archive Files on PI Server" is checked and the field "Archive name" is configured to archive the files on PI Server. During message processing, it is noticed, that, files are being archived in the archive directory with ".txt" extension.

Reason and Prerequisites

This feature has been added as a part of security so that the files will be saved with ".txt" extension in the archive directory. If it is allowed to be saved with original name on the PI server, then an external attack can manipulate the path where the file has been archived and gain access to OS related path and modify the files. Hence, to avoid such security issues, the file extension is always changed to ".txt".

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 21, 2017 at 02:06 PM
0

Thank you so much Evgeniy Kolmakov for your valueable reply.

Share
10 |10000 characters needed characters left characters exceeded