Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Python SMB Connection
-
-
@DavinE FTP is ok and SFTP (SSH) also
-
But my old WD NAS does not support SFTP...
-
from ftplib import FTP import paramiko
ftplib for FTP
paramiko for SFTP -
@cvp said:
from ftplib import FTP import paramiko
ftplib for FTP
paramiko for SFTPI know I'm annoying you a lot, but would you have a script like with SMB?
-
-
@DavinE upload or download?
-
-
@DavinE try first this
from ftplib import FTP ip = '192.168.0.47' user = 'admin' pwd = 'xxxxxxx'' ftp = FTP(ip) #connect ftp.encoding = 'utf-8' ftp.login(user,pwd) ftp.retrlines('NLST *') ftp.quit()
-
Upload
ftp = FTP(ip) #connect ftp.encoding = 'utf-8' ftp.login(user,pwd) local_file = open(path,'rb') ftp.storbinary('STOR '+server_file, local_file, blocksize=32768) local_file.close() ftp.quit()
-
-
@cvp said:
from ftplib import FTP import paramiko
ftplib for FTP
paramiko for SFTPThere is also FTPS is that better for security?
how can i use this with Ports ?from ftplib import FTP_TLS ftp = FTP_TLS() ftp.ssl_version = ssl.PROTOCOL_SSLv23 ftp.ssl_version = ssl.PROTOCOL_TLSv1_2 ftp.debugging = 2 ftp.connect('localhost', 2121) ftp.login('developer', 'password') return ftp
but which version TLS or SSL ?
-
-
@cvp said:
Upload
ftp = FTP(ip) #connect ftp.encoding = 'utf-8' ftp.login(user,pwd) local_file = open(path,'rb') ftp.storbinary('STOR '+server_file, local_file, blocksize=32768) local_file.close() ftp.quit()
server_file
is this this the storage Path ? -
@DavinE yes sir, but it may begin at first folder where you are authorized. try first without folder, only a file name to check after upload where it has been stored
-
@DavinE said:
There is also FTPS is that better for security?
how can i use this with Ports ?from ftplib import FTP_TLS
ftp = FTP_TLS()
ftp.ssl_version = ssl.PROTOCOL_SSLv23
ftp.ssl_version = ssl.PROTOCOL_TLSv1_2
ftp.debugging = 2
ftp.connect('localhost', 2121)
ftp.login('developer', 'password')
return ftp
but which version TLS or SSL ?Never used. If needed, I use SFTP
-
@cvp said:
@DavinE yes sir, but it may begin at first folder where you are authorized. try first without folder, only a file name to check after upload where it has been stored
@cvp really thanks a lot for your help!! and for your Time to help me out ;) Thanks!!
i played now a while and it works like i will create folders upload files etc. great!!
beautiful evening @cvp xD
-
@DavinE 👍
-
@cvp
I Have a Problem...I used this code:
self.subDirCustomer_Prüfungen = 'Prüfungen' self.cur.encoding = 'utf-8' self.cur.mkd(self.subDirCustomer_Prüfungen)
But i get this Output folder
Prüfungen
How can i tellmkd
to use the utf-8....Do you know That ?
-