FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FTP Upload works at home Not at work
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
FTP Upload works at home Not at work
Posted: Thu May 25, 2023 09: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 (fw): Select all Collapse
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.08 with Harbour
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: FTP Upload works at home Not at work
Posted: Fri May 26, 2023 05: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

Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: FTP Upload works at home Not at work
Posted: Fri May 26, 2023 09: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

https://forums.fivetechsupport.com/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.08 with Harbour
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: FTP Upload works at home Not at work
Posted: 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:
Posts: 130
Joined: Sun Mar 08, 2009 04:33 PM
Re: FTP Upload works at home Not at work
Posted: Mon Jul 17, 2023 06: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) ]
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: FTP Upload works at home Not at work
Posted: Mon Jul 17, 2023 07: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.08 with Harbour
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: FTP Upload works at home Not at work
Posted: Mon Jul 17, 2023 08: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.08 with Harbour

Continue the discussion