web stats
sFTP Destination "ReferenceError: "response" is not defined." - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2015, 10:47 AM
RPHaa RPHaa is offline
Mirth Newb
 
Join Date: Sep 2010
Location: St Petersburg, Florida
Posts: 17
RPHaa is on a distinguished road
Default sFTP Destination "ReferenceError: "response" is not defined."

I am building an sFTP send function in javascript. I get an error in the Mirth dashboard with the following text:

"34: // Construct the SftpConnection directly from the Mirth class
35: var sftpConnection = new Packages.com.mirth.connect.connectors.file.filesys tems.SftpConnection(targetIP,targetPort,sFTPuserna me,sFTPpassword, 10000);
36:
LINE NUMBER: 32
DETAILS: ReferenceError: "response" is not defined.


Does anyone know the syntax to capture an sFTP connection response into a variable in js? I have searched and searched in this forum and on google.
Perhaps I ma ot askingthe right question.

using a Mirth destination with the canned sFTP filewriter functionality works fine so I know the connection is being made.

thanks
--Pete
Reply With Quote
  #2  
Old 08-18-2015, 08:46 AM
RPHaa RPHaa is offline
Mirth Newb
 
Join Date: Sep 2010
Location: St Petersburg, Florida
Posts: 17
RPHaa is on a distinguished road
Default

Quote:
Originally Posted by RPHaa View Post
I am building an sFTP send function in javascript. I get an error in the Mirth dashboard with the following text:

"34: // Construct the SftpConnection directly from the Mirth class
35: var sftpConnection = new Packages.com.mirth.connect.connectors.file.filesys tems.SftpConnection(targetIP,targetPort,sFTPuserna me,sFTPpassword, 10000);
36:
LINE NUMBER: 32
DETAILS: ReferenceError: "response" is not defined.


Does anyone know the syntax to capture an sFTP connection response into a variable in js? I have searched and searched in this forum and on google.
Perhaps I ma ot askingthe right question.

using a Mirth destination with the canned sFTP filewriter functionality works fine so I know the connection is being made.

thanks
--Pete
The reason I am writing the sFTP function instead of using the standard Mirth destination config is because I want to create additional logging and error handling. currently with many documents it is not easy to determine which ones were actually sent and which ones are not.
Reply With Quote
  #3  
Old 11-06-2015, 07:13 AM
RPHaa RPHaa is offline
Mirth Newb
 
Join Date: Sep 2010
Location: St Petersburg, Florida
Posts: 17
RPHaa is on a distinguished road
Default basic sFTP commands

Using the "Packages.com.mirth.connect.connectors.file.filesy stems.SftpConnection"
I would really like to find a list of the basic commands that can be executed within the connection context. I need to:
1) CHANGE Directory to my source path folder
2) LIST the files in the folder
3) Identify the newest file 9 I am thinking that if I pull the list by filedate DESC then I can select the top file fileList(0) that comes up.
4) GET the file I have identified in Step 3 and bring it to my local server.

Standard UNIX commands don't work. JSCH commands do not work either.
Does anyone know if the actions listed above are possible? if so, where can I find a resource or list of these commands and their syntax?

I know I am a Noob to Mirth. I have been searching the forum and google for an hour now and cannot find what I am looking for.
Thanks in advance for your help.
Reply With Quote
  #4  
Old 11-06-2015, 07:43 AM
anadkat2000 anadkat2000 is offline
Mirth Newb
 
Join Date: May 2012
Posts: 20
anadkat2000 is on a distinguished road
Send a message via Yahoo to anadkat2000 Send a message via Skype™ to anadkat2000
Default sftp channel

Hi Peter,

You need to import jcraft package in your source. (importPackage (com.jcraft.jsch)).

Secondly, establish the session and channel connection with respect to your remote machine. Once this is done you can execute the command.

Please find the below mentioned link for jcraft and ChannelSftp command -
http://www.jcraft.com/jsch/
http://epaul.github.io/jsch-document...annelSftp.html


Feel free to contact me if you need any further help.

Thanks,
Sachin.
Reply With Quote
Reply

Tags
response, sftp

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:25 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation