SFTP Issues with PutAttachment & GetAttachment PeopleCode

Hey everyone!

Happy new year!

It’s been a while since I had blogged – here’s an interesting issue that I worked on. I have an AE process that uses PutAttachment and GetAttachment functions to upload a file to an SFTP server. Running a trace returned the following error:

736 08.06.23 0.000000 ExecutePutAttachment (error): Error: URL Identifier not provided. Use URL Identifier to connect.
737 08.06.23 0.000000 EvalPutAttachment (error): return code (1) indicates attempt to upload file to storage failed.
738 08.06.23 0.000000 EvalPutAttachment: finishing and returning 1.

When I looked at the code, the PutAttachment and GetAttachment functions were referencing a URL string instead of a URL definition.

PutAttachment(&URL, &att_ref | &array [&j], &URL_ID2);

Here, &URL is the variable referencing the SFTP URL.

It appears that if you would like to place files on an SFTP server, you would have to use the URL definition as such, instead of using a URL string. Using a URL string would work fine when you use a FTP URL. So, changing the PeopleCode to be as below, fixed this issue:

PutAttachment(URL.ATTACHMENT_SFTP_URL, &att_ref | &array [&j], &URL_ID2);

This was in PeopleSoft HCM 9.1 with PeopleTools 8.53.06 , by the way.

Hope this helps! 🙂



About Manikandan Surendren

A PeopleSoft Techno-functional Consultant. An engineering graduate in Computer Science. Technology Enthusiast. Movie freak. Gadget geek.
This entry was posted in Code, Oracle, PeopleSoft and tagged , , , . Bookmark the permalink.

2 Responses to SFTP Issues with PutAttachment & GetAttachment PeopleCode

  1. Anish says:

    Hello, I am trying to download a file from SFTP server using URL id but still am getting the error code 1.

    Below is the error :
    – EvalGetAttachment (error): return code (1) indicates attempt to download file from storage failed.

    Can you please help ?

    • Manikandan Surendren says:

      Hi Anish – can you please post the PeopleCode that is failing? What kind of authentication do you have on your URL definition? You can check this by clicking on the Properties hyperlink against your URL definition

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s