Page 1 of 1

FTP Upload problem (Solved)

Posted: Tue Sep 26, 2017 10:22 am
by mrcoollion
Hope some one sees what I am doing wrong because I have a problem uploading a file with tsNetUploadFileSync.

I get connection with the server and the server gives the below shown information back but tResultCode keeps giving me the error 'tsneterr: (30) Could not resolve host: 21'.
The result is no file uploaded to my FTP server.

-- Server reply ---
220-FileZilla Server 0.9.53 beta
220 Welcome to FTP Server.
331 Password required for customerid
230 Logged on
257 "/" is current directory.
250 CWD successful. "/CST0000000001" is current directory.
221 Goodbye
-- End Server Reply -----

Code: Select all

 put "ftp://"&tLoginID&":"&tCustPW&"@"&tServer_IP&"/"&tSubFolderName&"/"&tUploadedFileName into tFTPUploadInfo 
    put "" into tHeaders ; put "" into tRecvHeaders; put "" into tResultCode ; put "" into tBytes ; put "" into tResult // Empty all the variables just to be sure
    tsNetSetFTPPort tFTPPort
    put tsNetUploadFileSync(theFilePath, \
          tFTPUploadInfo, tHeaders, \
          tRecvHeaders, tResultCode, tBytes) into tResult    
Anything I am doing wrong?

Regards,

Paul

Re: FTP Upload problem

Posted: Tue Sep 26, 2017 12:17 pm
by mrcoollion
Found the reason for the problem.

I set the port to 21 with tsNetSetFTPPort
This was not necessary.
Setting tsNetSetFTPPort to "" makes it a passive transfer and that worked.

Regards,

Paul