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.)
Ok, I guess this reply is now irrelevant for you but maybe others can learn from it.
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 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... Hope I managed to discourage everyone from using it
Forum posts: 732
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);
}
Forum posts: 2133
Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant
Forum posts: 3
the other two are there for explaning the problem.
Forum posts: 85
Ok, I guess this reply is now irrelevant for you but maybe others can learn from it.
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
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...
Hope I managed to discourage everyone from using it