ftpSession problems
Login to reply to this topic.
Thu, 2006-09-21 07:28
Joined: 2006-09-21
Forum posts: 3
Hi,

I'm having trouble with the CFTPSession.Retrieve(...)

I'll get panic (User 11) if the length of in-param "const TDesC& aNewLocalFileName" is > 16

****Anyone who have a workaround for this?

if not, a other way is to work with
1.setting the SystemDefaultPath to the wanted path
2.make request to CFTP.Retrieve/Store and having 16characters for the filename.
3.replace previous SystemDefultPath (for other threads)

****How do you change the SystemDefaultPath?


Thanks in advance

(Im using the ftp-example (for S60 2nd Edition ) in a S60 3rd Edition because I havn't found any example spec for 3rd Ed.)

Thu, 2006-09-21 07:45
Joined: 2004-05-26
Forum posts: 732
Can you post the code here?

Thu, 2006-09-21 08:37
Joined: 2006-09-21
Forum posts: 3


void CFTP_Engine::RetrieveL( const TDesC& aRemoteFileName,
                  const TDesC& aLocalFileName)
{
   HBufC8* remoteFile = HBufC8::NewLC(aRemoteFileName.Length());
   TPtr8 rf(remoteFile->Des());
   rf.Copy(aRemoteFileName);


        _LIT(LocalFileName_16,"C:\\Data\\Awor.txt");       //16
        _LIT(LocalFileName_17,"C:\\Data\\Awork.txt");      //17
        _LIT(LocalFileName_18,"C:\\Data\\Aworks.txt");     //18

   iFtpSession->Retrieve(  rf, LocalFileName_16()  ); //works
   //iFtpSession->Retrieve(  rf, LocalFileName_17()  ); //=> panic User11
   //iFtpSession->Retrieve(  rf, LocalFileName_18()  ); //=> panic User11

       CleanupStack::PopAndDestroy(remoteFile);
}
Thu, 2006-09-21 10:04
Joined: 2003-01-14
Forum posts: 2133
I guess you should wait for a call to MFtpSessionNotifier::Complete() before re-issuing a second request to the FTP session.

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Thu, 2006-09-21 10:45
Joined: 2006-09-21
Forum posts: 3
Of the three different calls to iFtpSession->Retrieve (in the example code above) are only one used,

the other two are there for explaning the problem.
Mon, 2008-07-14 09:28
Joined: 2008-06-23
Forum posts: 85

Ok, I guess this reply is now irrelevant for you but maybe others can learn from it. Smiling

What I can say is that I was experiencing for about a month with the FTP API in 3rd and I can say that it is quite broken. Here's a list of bugs I've come across:

1. CFTPSession::ConnectL(TSockAddr, ...) (address by IP) does not work (throws Connection failed [Connection error 4] all the time), however, ConnectL(TDesc, ...) (address by DNS name) does. Don't ask why.

2. There is no way you could pass an RConnection or an IAP id to use, so you are likely to be prompted for the access point to use each time it's needed.

3. As you noticed, CFTPSession::Retrieve() has problems with filenames longer than 16 characters. Guess what, this is because the developer thought that a TBuf<16> would be enough for everybody. Well, he was wrong Sticking out tongue Even if your filenames are shorter than that, you can still run into trouble because those bloody 16 characters should be enough for the full path... However, you can try changing the current remote and local working directories, that might help to some extent.

4. CFTPSession::Store() does not allow the local and remote filenames/paths to be different (this means no renaming during upload!). (It seems that the remote file is searched on the local machine which obviously results in a File not found error [Local filesystem error 16].)

Well, these issues make the API rather unusable... Sad Hope I managed to discourage everyone from using it Sticking out tongue


copyright 2003-2009 NewLC SARL