10-09-2008 05:57 AM
I feel a little stupid once again.... ;-(
I ran the following simple code to read some files from a remote ftp server....
// Login to FTP site and set passive mode
ftp_handle = InetFTPLogin (server, username, password);
if (ftp_handle < 0)
{
InsertListItem(ChildPanel,INFOPANEL_INFOBOX,-1,"Server nicht gefunden",0);
return ;
}
InsertListItem(ChildPanel,INFOPANEL_INFOBOX,-1,"Login erfolgreich",0);
InetFTPSetPassiveMode (ftp_handle, 1);
// change dir
DisableBreakOnLibraryErrors ();
error = InetFTPChangeDir (ftp_handle, "stpara");
EnableBreakOnLibraryErrors ();
if (error)
{
InsertListItem(ChildPanel,INFOPANEL_INFOBOX,-1,"Kann Verzeichnis nicht wechseln...",0);
return ;
}
// get files
if ((error = InetFTPGetDirList (ftp_handle, &files, &num)) < 0)
{
// see comment after Error: label below
if (error <0)
{
;
}
}
... looks like it works until it wants to read the directory... gets stuck für 5 Minutes (!) and reports Error -11 and a hint to try "passive mode" .
I´m scratching my head ...
HELP - it´s not a really important project, but i´d like to impress my boss with online update compatibility.
all the best
dos
10-09-2008 09:17 AM
10-10-2008 02:13 AM
Thank you very much for your reply.
I´m using our company ftp server. I tried a connect in a terminal window, the chdir command works both in terminal and in CVI. The directory is not empty and the local working directory is double checked and ok.
I get a "-13" error which says - unbeliebable - "ftp error" and this is the really annoying part: i´ve no chance finding out what the realy problem is. Is there any chance doing a "lower level access"? I´m sure i made a mistake but how to find out?
The last alternative that could keep me going would be running system commands....
best regards
Dominik
10-10-2008 07:05 AM
10-10-2008 09:42 AM
Hmm... I am not sure I understand. You are saying the chdir command works both in terminal and CVI. By this, do you mean everything is fine in terminal and CVI? Also, by CVI do you mean some sample program or your program? Which function returns -13? -13 refere to "kInetFTPFileError" and this is returned if there was an FTP protocol error relating to some file or directory. Have you tried browsing to this directory using the Windows console FTP command and Internet Explorer? You may want to try this.
Does this error only happen with one specific directory on the server or with all directories? See if there is anything strange about the directory name, or the names of the contents of the directory. Try renaming this server directory and changing the contents of the directory. Also, what FTP server are you running on the server machine? You should check the documentation of the server to see if there are any special issues with certain directory and file names, etc. You may also want to try running a different FTP server.