With
InternetConnect[
^] you are only supposed to specify the server name you want to connect to. After making the connection use
FtpSetCurrentDirectory[
^] to change the folder on the FTP server.
By the way please note that you are uploading the file two times.
Replace:
FtpPutFile(hService, szLocalFile, szLocalFile, FTP_TRANSFER_TYPE_BINARY, 0);
if((FtpPutFile(hService, szLocalFile, szRemoteFile, FTP_TRANSFER_TYPE_BINARY, 0))==false) cout<<"false";
with:
if( !FtpPutFile(hService, szLocalFile, szRemoteFile, FTP_TRANSFER_TYPE_BINARY, 0) )
cout<<"false";