ftplib python module for download / upload / delete / rename / listing files over FTP server

  Рет қаралды 14,625

Learning Software

Learning Software

Күн бұрын

Пікірлер: 34
@juandiegoflorezruiz
@juandiegoflorezruiz 2 жыл бұрын
Wasting almost half a day trying to access some ftp. u saved my life with the ssl command. Thank u so much!
@learningsoftwareskills
@learningsoftwareskills Жыл бұрын
You are welcome 👍
@randor73
@randor73 2 жыл бұрын
Thank you for a great tutorial! You have a knack for explaining things in its simplest terms! Kudos sir!
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
Thanks for such a nice feedback👍
@alexthewebdesigner1856
@alexthewebdesigner1856 2 жыл бұрын
Sir, thank you so much for posting.this vid! I wasted 2 hours trying to get Paramiko and PySFTP to work, with no success.
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
Hi, thanks for the wonderful feedback 👍
@23nassim92
@23nassim92 2 жыл бұрын
thank you ur the best
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
Thanks for the awesome feedback 👍
@AndrésEduardoSuárezRojas
@AndrésEduardoSuárezRojas Жыл бұрын
Gracias!!!
@learningsoftwareskills
@learningsoftwareskills Жыл бұрын
Thanks 👍
@arushichoudhary1380
@arushichoudhary1380 2 жыл бұрын
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
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
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 👍
@arushichoudhary1380
@arushichoudhary1380 2 жыл бұрын
Thank you that was helpful
@bawadhut
@bawadhut 2 жыл бұрын
👍🏼
@pradeepkumar-h9u7r
@pradeepkumar-h9u7r 8 ай бұрын
Hello Sir, how can we copy folders over ftp?
@learningsoftwareskills
@learningsoftwareskills 8 ай бұрын
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 👍
@ieatmagic8053
@ieatmagic8053 2 жыл бұрын
how to overwrite folders in ftp ?
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
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👍
@sn-op8oi
@sn-op8oi 2 жыл бұрын
Hi is there any process to send file from server location A to another server location B
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
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👍
@shanmukha599
@shanmukha599 Ай бұрын
Could any one tell how to connect FTP with IBM sessions(main frame ) is it possible?
@prabhatgupta9808
@prabhatgupta9808 2 жыл бұрын
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
@learningsoftwareskills 2 жыл бұрын
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👍
@sn-op8oi
@sn-op8oi 2 жыл бұрын
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?
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
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-op8oi
@sn-op8oi 2 жыл бұрын
@@learningsoftwareskills mlsd is blocked is there any other way?
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
@@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 👍
@jaikumarm6964
@jaikumarm6964 2 жыл бұрын
hi iam getting erro:socket.timeout:timeout in ftp
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
Hi, this may be due to firewall policy blocking or network issues. Please check the firewall policy Hope this helps, Cheers 👍
@jaikumarm6964
@jaikumarm6964 2 жыл бұрын
Thank you
@arushichoudhary1380
@arushichoudhary1380 2 жыл бұрын
Thank u it was extremely helpful ,can u also provide a solution about how to find the timestamps of the files on ftp server
@learningsoftwareskills
@learningsoftwareskills 2 жыл бұрын
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👍
@fadeblox149
@fadeblox149 Жыл бұрын
i awant to upload dir
@learningsoftwareskills
@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 👍
SFTP in python with pysftp along with examples
24:30
Learning Software
Рет қаралды 24 М.
КОНЦЕРТЫ:  2 сезон | 1 выпуск | Камызяки
46:36
ТНТ Смотри еще!
Рет қаралды 3,7 МЛН
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.
진짜✅ 아님 가짜❌???
0:21
승비니 Seungbini
Рет қаралды 10 МЛН
This INCREDIBLE trick will speed up your data processes.
12:54
Rob Mulla
Рет қаралды 272 М.
Python Sockets Simply Explained
39:33
NeuralNine
Рет қаралды 169 М.
Python Socket Programming Tutorial
49:43
Tech With Tim
Рет қаралды 1 МЛН
Learning Awk Is Essential For Linux Users
20:02
DistroTube
Рет қаралды 312 М.
Simple Automated SSH Python Bot
17:50
NeuralNine
Рет қаралды 33 М.
get the latest file from an ftp folder with python ftplib
13:53
Learning Software
Рет қаралды 2 М.