FTP Upload works at home Not at work

FTP Upload works at home Not at work

Postby Marc Venken » Thu May 25, 2023 9:31 pm

The code below (From Otto in the forum) is working for upload by FTP from my home internet

The same laptop connected at work, but a other network and the filename is uploaded but the size stay at 0 and afther 20-30 secs a No Send message ?

At work I have a rooter, a gateway

At home a rooter no gateway

Where in the firewall ?? do I have to change a parameter to let the FTP work ?

Code: Select all  Expand view  RUN
function Upload( cDatei )
   local oInternet := TInternet():New()
   local oFTP := TFTP():New( cFtpHost, oInternet, cUser, cLogin )
   local aInfo := {}
   local I := 0
   local cDir :=  "c:\marc32" //Setup():Daten() + "\xReport"
   local cFile:="c:\marc32\test.jpg"

   *----------------------------------------------------------
   xbrowser(oFtp)
   if Empty( oFTP:hFTP )
      MsgStop( "Cannot connect to the specified FTP site!" )
      return nil
   endif
   if ! Empty( oFTP:hFTP )
       if  FTPPUTFILE(  oFTP:hFTP,  cFile,"\fivewin\test2.jpg"  , 0, 0 ) = .t.
          msginfo("Send")
       else
          msginfo("No Send")
       endif
   else
      MsgAlert( "oFTP:hFTP is null" )
   endif
   oInternet:End()
return nil
 
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: FTP Upload works at home Not at work

Postby Otto » Fri May 26, 2023 5:49 am

Mark,
Have you checked firewall settings: Make sure that the firewall on your work network allows outgoing FTP connections.
FTP typically uses ports 20 and 21 for data transfer. Ensure that these ports are not blocked by the firewall.
What if you test with TotalCommander's FTP?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: FTP Upload works at home Not at work

Postby Marc Venken » Fri May 26, 2023 9:07 am

Otto,

It does work with TC... and also at home.

I put the exe in defender and also the folder no good
Defender offline : no good

Strange that the filename is uploaded, but the size stays 0

Other topic mentionend a SetTimeout function, but that I can't get working

viewtopic.php?f=3&t=40321

There is also a topic mentioned by Antonio with working sample, but they are not click and go like yours. Remember it is working at home,
so there is a issue with defender, port or gateway.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: FTP Upload works at home Not at work

Postby Otto » Fri May 26, 2023 12:32 pm

Mark,
mayby tracert can help you?
Passive mode was a problem for me sometimes
Best regards,
Otto

The tracert command is used to trace the route that network packets take from your computer to a destination IP address or domain name. It is typically used to diagnose network connectivity issues. On the other hand, FTP (File Transfer Protocol) is a standard network protocol used for transferring files between a client and a server on a computer network.

The tracert command is not directly used to check FTP connectivity. However, you can use it to check the network connectivity to an FTP server by tracing the route to the server's IP address or domain name. This can help identify any network hops or issues along the way.

To use tracert to check FTP connectivity, you need to know the IP address or domain name of the FTP server. Open a command prompt or terminal window and type the following command:
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: FTP Upload works at home Not at work

Postby mtajkov » Mon Jul 17, 2023 6:18 pm

Mark,

I have the same problem as you (the file name is uploaded but the size is 0), did you solve the problem?

Regards
Miloš
Best regards
Milos

[ FWH 21.11 ] [ xHarbour 1.2.3 Intl. (SimpLex) (Build 20150603) ]
mtajkov
 
Posts: 130
Joined: Sun Mar 08, 2009 4:33 pm

Re: FTP Upload works at home Not at work

Postby Marc Venken » Mon Jul 17, 2023 7:55 pm

No I did not.

I now copy the files to a location and use a manual FTP upload. In my case it's the same laptop there I take home and at work, so it need to be settings for
antivirus or router .or. ....
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: FTP Upload works at home Not at work

Postby Marc Venken » Mon Jul 17, 2023 8:28 pm

I do see now that in Win Defender my program has 2 occurences

Factumat 32 with selected : Private and NOT public
Factumat 32 with selected : NOT Private but Public

Tomorrow I will this what happence when I have 1 occurence, but with both Private and Public activated.
Just a wild guess
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests