Wasting almost half a day trying to access some ftp. u saved my life with the ssl command. Thank u so much!
@learningsoftwareskills Жыл бұрын
You are welcome 👍
@alexthewebdesigner18562 жыл бұрын
Sir, thank you so much for posting.this vid! I wasted 2 hours trying to get Paramiko and PySFTP to work, with no success.
@learningsoftwareskills2 жыл бұрын
Hi, thanks for the wonderful feedback 👍
@randor732 жыл бұрын
Thank you for a great tutorial! You have a knack for explaining things in its simplest terms! Kudos sir!
@learningsoftwareskills2 жыл бұрын
Thanks for such a nice feedback👍
@prabhatgupta98082 жыл бұрын
Hello, Thank you so much for making this wonderful video, this video is exactly what i was looking for. just few more doubts i have, i would really appreciate if you could respond. 1. is there any way we can copy/move files from one dir to another dir on ftp? 2. can we read the file on ftp before downloading (as per my requirement i need to check if file is relevant before downloading it). Thanks in advance, keep up the good work.
@learningsoftwareskills Жыл бұрын
Hi, thanks for your appreciation 1. You can explore the rename command to move files remotely the FTP server ( docs.python.org/3/library/ftplib.html#ftplib.FTP.rename ) 2. You can read the contents of an FTP file into a variable using retrlines command as shown in the below example ( docs.python.org/3/library/ftplib.html#ftplib.FTP.retrlines ) lines = [] filename="abcd.txt" ftp.retrlines("RETR " + filename, lines.append) Hope this helps, Cheers👍
@arushichoudhary13802 жыл бұрын
Thank u it was extremely helpful ,can u also provide a solution about how to find the timestamps of the files on ftp server
@learningsoftwareskills2 жыл бұрын
Hi, I have found a solution at stackoverflow.com/a/29027386/2746323 If you want to find the timestamp of a single file, you can use ######################### code start timestamp = ftp.voidcmd("MDTM /remote/path/file.txt")[4:].strip() time = parser.parse(timestamp) ######################### code end If you want to find the timestamps of all the files in a remote folder, you can use ######################### code start from ftplib import FTP from dateutil import parser # ... (connection to FTP) files = ftp.mlsd("/remote/path") for file in files: name = file[0] timestamp = file[1]['modify'] time = parser.parse(timestamp) print(name + ' - ' + str(time)) ######################### code end Hope this helps Cheers👍
@23nassim922 жыл бұрын
thank you ur the best
@learningsoftwareskills2 жыл бұрын
Thanks for the awesome feedback 👍
@arushichoudhary13802 жыл бұрын
Thanku so much it helped a lot also can u please tell me if hostname is some IP address instead of localhost so can the code still works because I;m trying and it is showing me some error
@learningsoftwareskills2 жыл бұрын
Hi, using a hostname like "15.25.56.76" is valid. Please mention what error you are getting. You can also check if ssl is required. Also check the connectivity with winscp. Hope this helps Cheers 👍
@arushichoudhary13802 жыл бұрын
Thank you that was helpful
@pradeepkumar-h9u7r5 ай бұрын
Hello Sir, how can we copy folders over ftp?
@learningsoftwareskills5 ай бұрын
Hi, you can't directly copy folders to FTP. You can create a folder in the remote server using the ftp.mkd command and then copy all the files one by one. Hope this helps, cheers 👍
@AndrésEduardoSuárezRojas Жыл бұрын
Gracias!!!
@learningsoftwareskills Жыл бұрын
Thanks 👍
@bawadhut2 жыл бұрын
👍🏼
@sn-op8oi2 жыл бұрын
Hi is there any process to send file from server location A to another server location B
@learningsoftwareskills2 жыл бұрын
Hi, there can be several approaches to solve this problem depending on the security considerations. You can host an FTP server at location A and host the files in the FTP folder, and copy that file to location B using a script in server B. Hope this helps, Cheers👍
@sn-op8oi2 жыл бұрын
Hi I need to download the names of those files which were uploaded in last 48 hours. How do I extract the time stamp and get those file names?
@learningsoftwareskills2 жыл бұрын
Hi, use can use ftplib MLSD function to get the modified times along with filenames of all files in an FTP directory. Please see the solution in this link stackoverflow.com/a/29027386 Hope this helps, Cheers 👍
@sn-op8oi2 жыл бұрын
@@learningsoftwareskills mlsd is blocked is there any other way?
@learningsoftwareskills2 жыл бұрын
@@sn-op8oi Hi, then you can use ftp.dir command. The example code is present in the same stackoverflow post at stackoverflow.com/questions/29026709/how-to-get-ftp-files-modify-time-using-python-ftplib/29027386#29027386 Cheers 👍
@ieatmagic80532 жыл бұрын
how to overwrite folders in ftp ?
@learningsoftwareskills2 жыл бұрын
Hi, if you want to upload the contents of a whole folder, you can iterate through each file of the local folder using a for loop and upload each file using the storbinary function ( 09:38 ). If a file exists, it will be overwritten anyway. If you have nested folders, you have to ensure them in the remote location before uploading files in nested folders. Unfortunately, You have to implement the above algorithm yourself. If I find any implementation online, I will comment here Hope this helps, Cheers👍
@jaikumarm6964 Жыл бұрын
hi iam getting erro:socket.timeout:timeout in ftp
@learningsoftwareskills Жыл бұрын
Hi, this may be due to firewall policy blocking or network issues. Please check the firewall policy Hope this helps, Cheers 👍
@jaikumarm6964 Жыл бұрын
Thank you
@fadeblox149 Жыл бұрын
i awant to upload dir
@learningsoftwareskills Жыл бұрын
Hi, you can use ftp.mkd to create a folder in the FTP server, then upload the files in the created folder. Hope this helps, cheers 👍