Page 1 of 1

FTP Upload works at home Not at work

PostPosted: Thu May 25, 2023 9:31 pm
by Marc Venken
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
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
 

Re: FTP Upload works at home Not at work

PostPosted: Fri May 26, 2023 5:49 am
by Otto
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

Re: FTP Upload works at home Not at work

PostPosted: Fri May 26, 2023 9:07 am
by Marc Venken
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.

Re: FTP Upload works at home Not at work

PostPosted: Fri May 26, 2023 12:32 pm
by Otto
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:

Re: FTP Upload works at home Not at work

PostPosted: Mon Jul 17, 2023 6:18 pm
by mtajkov
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š

Re: FTP Upload works at home Not at work

PostPosted: Mon Jul 17, 2023 7:55 pm
by Marc Venken
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. ....

Re: FTP Upload works at home Not at work

PostPosted: Mon Jul 17, 2023 8:28 pm
by Marc Venken
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