A program to recognize and reward our most engaged community members
Hi,
Any News about SFTP access in the last 5 years?
Regards
Julian
bump.
hello @robin - feel free to post in Ideas -> Product Ideas. People can upvote, etc.. there.
Scott
Not the most straightforward way but I do this using python.
There are plenty of sftp libraries available, most have decent copy paste examples so you don't need to be a coding geek to get it running.
Below is a basic script using ftplib to upload a file. Unfortunatly it isn't sftp (can't find back immediatly where I used it) but the principle remains the same.
<?xml version="1.0" encoding="UTF-8"?><process version="7.6.001"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="7.6.001" expanded="true" name="Process"> <parameter key="logverbosity" value="init"/> <parameter key="random_seed" value="2001"/> <parameter key="send_mail" value="never"/> <parameter key="notification_email" value=""/> <parameter key="process_duration_for_mail" value="30"/> <parameter key="encoding" value="UTF-8"/> <process expanded="true"> <operator activated="true" class="set_macros" compatibility="7.6.001" expanded="true" height="68" name="file variables" width="90" x="112" y="34"> <list key="macros"> <parameter key="from" value="%{your_source_path}"/> <parameter key="to" value="%{your_destination_path}"/> <parameter key="filename" value="%{your_file}"/> </list> </operator> <operator activated="true" class="python_scripting:execute_python" compatibility="7.4.000" expanded="true" height="68" name="upload file" width="90" x="246" y="34"> <parameter key="script" value="import pandas as pd from ftplib import FTP def rm_main(): ftp = FTP('ftp_address') #ftp.login(user='username', passwd = 'password') ftp.login() target = "%{from}/%{filename}" ftp.cwd("%{to}") try: f = open(target, "rb") ftp.storbinary('STOR '+'%{filename}', f) f.close() ftp.quit() print("success") except: print("failed") return "/> </operator> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> </process> </operator></process>
and for download
<?xml version="1.0" encoding="UTF-8"?><process version="7.6.001"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="7.6.001" expanded="true" name="Process"> <parameter key="logverbosity" value="init"/> <parameter key="random_seed" value="2001"/> <parameter key="send_mail" value="never"/> <parameter key="notification_email" value=""/> <parameter key="process_duration_for_mail" value="30"/> <parameter key="encoding" value="UTF-8"/> <process expanded="true"> <operator activated="true" class="set_macros" compatibility="7.6.001" expanded="true" height="68" name="file variables" width="90" x="112" y="34"> <list key="macros"> <parameter key="from" value="your_sourcepath"/> <parameter key="to" value="your_destination_path"/> <parameter key="filename" value="sample.txt"/> </list> </operator> <operator activated="true" class="python_scripting:execute_python" compatibility="7.4.000" expanded="true" height="68" name="download file" width="90" x="246" y="34"> <parameter key="script" value="import pandas as pd import os from ftplib import FTP def rm_main(): ftp = FTP('your_ftp_address') #ftp.login(user='username', passwd = 'password') ftp.login() 	 ftp.cwd("%{from}") filename = "%{filename}" target = os.path.join("%{to}",filename) try: f = open(target, 'wb') ftp.retrbinary('RETR ' + filename, f.write) f.close ftp.quit() print("success") except: print("failed") return "/> </operator> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> </process> </operator></process>
Look for sftp examples and change the code accordingly, ask your local python guru for support if needed but it's less scary as it looks at first glance