Running Peopletools 8.51.x. A lot has been mentioned about sFTP support in PT 8.51, so today decided to give that a shot. For the POC I am trying to send a extract ascii text file (developed using XMLP eTEXT) via sFTP to a target location.
where MY_URL is the URL definition created above
&filename is the filename as in test.txt
and &fullpathtofile is the complete path as in C:\temp\test.txt
That's all, works like a charm, so no more 3rd party products.
Thanks
Deepak.
- Setup URL Definition.
- My URL has the form sftp://servername/destination_directory. Did not specify the port number, which generally is 22.
- Setup URL properties. In my case AUTHTYPE is password, as I am using a basic userid/password type of authentication. Other types like using private/public keys is also available, but I haven't tried that yet. (I did try it here)
- I encrypted the password using the password encryption option available on this page.
- Note: Though the password is encrypted online, the actual value is stored in a plain text field in the db, so can be queried using a query tool (PS_PT_URL_PROPS, is the name of the table where the properties are stored)
- Now test this via the PeopleTools Test Utility page. Once you this working proceed to the next step.
- Develop an AE program and add a peoplecode step.
- The following code will do the trick
where MY_URL is the URL definition created above
&filename is the filename as in test.txt
and &fullpathtofile is the complete path as in C:\temp\test.txt
That's all, works like a charm, so no more 3rd party products.
Thanks
Deepak.
While migrating the URL definition from one database to another using Application Designer, the URL properties are not copied. So a DMS script or re-keying of the properties is necessary to update the target db.
ReplyDeleteWhat if the Source File is in sftp?
ReplyDeleteNot sure I follow your question Sujith?
DeleteIf i want to read a file from a sftp, what i have to do?
Deleteuse GetAttachment function
DeleteI am getting &returncode - 9...
ReplyDeleteAfetr checking in Peoplebooks this is what i found
Cannot locate file.
The following are some possible situations where %Attachment_FileNotFound could be returned:
Remote file not found.
Failed to read remote file.
But the file is there in location...
Do we need to give &pathtofile differently while working in remote desktop connection?
Please help..
I am using this method on a windows server (using SQL Server db). Not sure if you are using a Windows Server too or Unix. I am not sure if there are any other settings required for Unix server, but this has worked for me either using absolute path to a named drive letter or even UNC path.
DeleteVerify if the file is closed and not being used elsewhere.
Local string &local_path1 = "C:\Users\dumpaala.vasu\Images\pic1.JPG";
ReplyDeleteLocal string &targetfilename1 = "pic1.JPG";
Local string &extension = Right(&local_path1, 4);
MessageBox(0, "", 0, 0, &extension, 0);
If &extension = ".JPG" Then
&RetCode = PutAttachment(URL.MASS_IMG_SFTP, &targetfilename1, &local_path1);
This is the code I am using and we are using linux server...
ReplyDeleteCan you please share the process for linux server
What method or file attachment should I use for sending file from local machine(not app server) to sftp?
ReplyDelete