Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FTP error on loop
Message
 
À
08/02/2017 16:07:36
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
West Wind Web Connection
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2008 R2
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01647704
Message ID:
01648242
Vues:
28
>>Hi all,
>>I have a program that will upload a file via FTP to a remote server. It works well is there is just 1 file, however if there are multiple files then I get an error on the 2nd and subsequent files about variable nFtpPort. the code that I call is below and I pass the variable correctly as it works when there is only 1 file. Any help appreciated as I'm a bit stuck.
>>
>>
PARAMETERS pcServer,pnPort,pcUser,pcPass,pcLocalName,pcFtpName
>>
>>SET PROCEDURE TO wwftp addi
>>
>>LOCAL o as wwFtp
>>
>>o=create("wwFTP")
>>
>>o.lPassiveFtp = .T.
>>
>>o.nFtpPort = pnPort
>>
>>? o.FTPConnect(pcServer,pcUser,pcPass)
>>
>>? o.FtpSendFileEx2(pcLocalName,pcFtpName)
>>
>>o.FtpClose()
>>
>>o=null
>>
>>WAIT clear
>
>Are you calling all of this for each file? The possible cause then is that some ftp sites won't allow too many connections from the same address within some time. You should check error codes and error messages that your ftp object is surely catching. I'm using ftp_service by Robert Abram, Martina Jindrová et al, and there I have
>
		with this.oHandler
>			if	.getextendederrorCode()=0
>				lcMsg="OK " + .getextendederrormsg()
>			else
>				lcMsg="error - "+.getextendederrormsg()
>			endif
>		ENDWITH
>The resulting string is then logged so I know what went on. One thing I noticed on my website is that if I send files, then quickly after that send some more, after a couple of times it would just kick me off with "too many connections from the same IP in short time" or some such excuse. So perhaps you should connect, do your files, disconnect - IOW keep the connection open, not open/close for every file.
I think that the quick sucession of connection was the problem, open once per file transfer and all was okay, thanks.
~M
Go raibh maith agat

~M
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform