E edgar_ortiz Active Member Licensed User Longtime User Sep 22, 2020 #1 Thanking you in advance for your time, I can't download files using FTP. Using CoreFTP I can connect with the credentials: Server: hairofthedog.dreamhost.com User: testftpsc Password: 2020FTPtest # Spoiler: Logs Logger connected to: samsung SM-A305G --------- beginning of main *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** Nothing interesting ** Activity (main) Resume ** *** Service (cargarpdf) Create *** ** Service (cargarpdf) Start ** BEGIN: RevisarPDFs Files to Download: 000007.pdf 000006.pdf 000004.pdf 000002.pdf 000001.pdf Downloading the File: 000007.pdf To Folder: /storage/emulated/0/Android/data/ftp.test/files File 000007.pdf downloaded. Success = false android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out) Downloading the File: 000006.pdf To Folder: /storage/emulated/0/Android/data/ftp.test/files File 000006.pdf downloaded. Success = false android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out) Downloading the File: 000004.pdf To Folder: /storage/emulated/0/Android/data/ftp.test/files File 000004.pdf downloaded. Success = false android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out) Downloading the File: 000002.pdf To Folder: /storage/emulated/0/Android/data/ftp.test/files What am I doing wrong? Regards, Edgar Attachments Test_FTP.zip Test_FTP.zip 10.8 KB · Views: 435
Thanking you in advance for your time, I can't download files using FTP. Using CoreFTP I can connect with the credentials: Server: hairofthedog.dreamhost.com User: testftpsc Password: 2020FTPtest # Spoiler: Logs Logger connected to: samsung SM-A305G --------- beginning of main *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** Nothing interesting ** Activity (main) Resume ** *** Service (cargarpdf) Create *** ** Service (cargarpdf) Start ** BEGIN: RevisarPDFs Files to Download: 000007.pdf 000006.pdf 000004.pdf 000002.pdf 000001.pdf Downloading the File: 000007.pdf To Folder: /storage/emulated/0/Android/data/ftp.test/files File 000007.pdf downloaded. Success = false android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out) Downloading the File: 000006.pdf To Folder: /storage/emulated/0/Android/data/ftp.test/files File 000006.pdf downloaded. Success = false android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out) Downloading the File: 000004.pdf To Folder: /storage/emulated/0/Android/data/ftp.test/files File 000004.pdf downloaded. Success = false android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out) Downloading the File: 000002.pdf To Folder: /storage/emulated/0/Android/data/ftp.test/files What am I doing wrong? Regards, Edgar
A amykonio Active Member Licensed User Longtime User Sep 22, 2020 #2 Hi. What is the exact problem? You receive an error when you run the program? The Net library is listed and selected in the library manager? If not you will have to download it. New Net library - Android FTP, SMTP and POP3 The Net library supports FTP, SMTP and POP3 protocols. This library replaces the FTP library. Both regular connections and SSL connections are supported. SMTP - Allows to directly connect to SMTP mail servers and send mails, including Html messages and attachments. POP3 - Allows to directly... www.b4x.com Also I would put ftp initialization in a try catch block. And I would check the is B4X: Copy Try ftp.PassiveMode = True ftp.Initialize("ftp", "hairofthedog.dreamhost.com", lcFtpPuerto, "testftpsc", "2020FTPtest#") If Not(ftp.IsInitialized) Then Log("Not able to initialize ftp...") Return End If Catch Log(LastException) End Try Andreas. Last edited: Sep 22, 2020 Upvote 0
Hi. What is the exact problem? You receive an error when you run the program? The Net library is listed and selected in the library manager? If not you will have to download it. New Net library - Android FTP, SMTP and POP3 The Net library supports FTP, SMTP and POP3 protocols. This library replaces the FTP library. Both regular connections and SSL connections are supported. SMTP - Allows to directly connect to SMTP mail servers and send mails, including Html messages and attachments. POP3 - Allows to directly... www.b4x.com Also I would put ftp initialization in a try catch block. And I would check the is B4X: Copy Try ftp.PassiveMode = True ftp.Initialize("ftp", "hairofthedog.dreamhost.com", lcFtpPuerto, "testftpsc", "2020FTPtest#") If Not(ftp.IsInitialized) Then Log("Not able to initialize ftp...") Return End If Catch Log(LastException) End Try Andreas.
Erel B4X founder Staff member Licensed User Longtime User Sep 22, 2020 #3 First step is to make a FTP.ListFiles call and check the list of files. Upvote 0
JohnC Expert Licensed User Longtime User Sep 22, 2020 #4 Also, you might need to add this to your manifest so non-ssl connections can be made: B4X: Copy SetApplicationAttribute(android:usesCleartextTraffic, "true") Upvote 0
Also, you might need to add this to your manifest so non-ssl connections can be made: B4X: Copy SetApplicationAttribute(android:usesCleartextTraffic, "true")
Jorge M A Well-Known Member Licensed User Longtime User Sep 22, 2020 #5 ...and you can try to increase timeout miliseconds. B4X: Copy FTP.TimeoutMs=90000 Upvote 0
E edgar_ortiz Active Member Licensed User Longtime User Sep 23, 2020 #6 Thanks for your time. I already updated the zip of the original post. I also tried the above recommendations and it still does NOT work, always gives the error: android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out) Upvote 0
Thanks for your time. I already updated the zip of the original post. I also tried the above recommendations and it still does NOT work, always gives the error: android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)
JohnC Expert Licensed User Longtime User Sep 23, 2020 #7 Question, is CoreFTP an app running on the same phone as this test app? Do you have admin access to the ftp server you are trying to download from? If so, maybe looking at the FTP logs on the server might give us a hint on what the problem is. Upvote 0
Question, is CoreFTP an app running on the same phone as this test app? Do you have admin access to the ftp server you are trying to download from? If so, maybe looking at the FTP logs on the server might give us a hint on what the problem is.
E edgar_ortiz Active Member Licensed User Longtime User Sep 23, 2020 #8 JohnC, Thank you JohnC said: Question, is CoreFTP an app running on the same phone as this test app? Do you have admin access to the ftp server you are trying to download from? If so, maybe looking at the FTP logs on the server might give us a hint on what the problem is. Click to expand... CoreFTP runs on a PC. I installed an FTP application from the store and it does NOT work on the phone. the server log says: (and i have no idea what it means) seico@hairofthedog:~/logs/seico.com.gt/http$ cat error.log [Tue Sep 22 02:32:00.999854 2020] [cgi:error] [pid 8761:tid 4018973681408] [client 27.210.10.133:40037] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi [Tue Sep 22 03:42:14.562513 2020] [cgi:error] [pid 8761:tid 4017807685376] [client 39.86.96.42:36069] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi [Tue Sep 22 16:29:28.116192 2020] [cgi:error] [pid 1745:tid 4017522464512] [client 180.104.252.129:3855] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi Regards Edgar Upvote 0
JohnC, Thank you JohnC said: Question, is CoreFTP an app running on the same phone as this test app? Do you have admin access to the ftp server you are trying to download from? If so, maybe looking at the FTP logs on the server might give us a hint on what the problem is. Click to expand... CoreFTP runs on a PC. I installed an FTP application from the store and it does NOT work on the phone. the server log says: (and i have no idea what it means) seico@hairofthedog:~/logs/seico.com.gt/http$ cat error.log [Tue Sep 22 02:32:00.999854 2020] [cgi:error] [pid 8761:tid 4018973681408] [client 27.210.10.133:40037] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi [Tue Sep 22 03:42:14.562513 2020] [cgi:error] [pid 8761:tid 4017807685376] [client 39.86.96.42:36069] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi [Tue Sep 22 16:29:28.116192 2020] [cgi:error] [pid 1745:tid 4017522464512] [client 180.104.252.129:3855] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi Regards Edgar
E edgar_ortiz Active Member Licensed User Longtime User Sep 23, 2020 #9 The problem is on the server Upvote 0
PdeG Member Licensed User Longtime User Sep 23, 2020 #10 I just tested the attached application and it downloads 5 pdf files. Upvote 0
E edgar_ortiz Active Member Licensed User Longtime User Sep 23, 2020 #11 PdeG said: I just tested the attached application and it downloads 5 pdf files. Click to expand... Thank you... the problem in on the server. Upvote 0
PdeG said: I just tested the attached application and it downloads 5 pdf files. Click to expand... Thank you... the problem in on the server.
JohnC Expert Licensed User Longtime User Sep 23, 2020 #12 edgar_ortiz said: the server log says: (and i have no idea what it means) seico@hairofthedog:~/logs/seico.com.gt/http$ cat error.log [Tue Sep 22 02:32:00.999854 2020] [cgi:error] [pid 8761:tid 4018973681408] [client 27.210.10.133:40037] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi [Tue Sep 22 03:42:14.562513 2020] [cgi:error] [pid 8761:tid 4017807685376] [client 39.86.96.42:36069] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi [Tue Sep 22 16:29:28.116192 2020] [cgi:error] [pid 1745:tid 4017522464512] [client 180.104.252.129:3855] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi Click to expand... The above error looks like a script is used to generate the server log and there is an error with the script, preventing it from displaying the actual log files. I would contact your hosting provider to have this script error fixed, then you should be able to see the FTP logs and hopefully figure out what is going wrong. Upvote 0
edgar_ortiz said: the server log says: (and i have no idea what it means) seico@hairofthedog:~/logs/seico.com.gt/http$ cat error.log [Tue Sep 22 02:32:00.999854 2020] [cgi:error] [pid 8761:tid 4018973681408] [client 27.210.10.133:40037] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi [Tue Sep 22 03:42:14.562513 2020] [cgi:error] [pid 8761:tid 4017807685376] [client 39.86.96.42:36069] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi [Tue Sep 22 16:29:28.116192 2020] [cgi:error] [pid 1745:tid 4017522464512] [client 180.104.252.129:3855] AH02811: script not found or unable to stat: /home/seico/seico.com.gt/setup.cgi Click to expand... The above error looks like a script is used to generate the server log and there is an error with the script, preventing it from displaying the actual log files. I would contact your hosting provider to have this script error fixed, then you should be able to see the FTP logs and hopefully figure out what is going wrong.