There is no HTTP stack APIs in the Symbian platform, if developers want HTTP, they have to implement it themselves. There are some stuff about FTP, but there is no documentation about using this in the SDK Help, anyway FTP functionalities can be found from the header file comftp.h from the Crystal V6.0 SDKs.
Some unfinished code as an outline is presented in the lines below.
You'll need to create an instance of CFileTransferManager and then
CreateProtocolByNameL to create an instance of CFileTransfer.
Here's some code to do the actual send of a set of files:
void sendSomeFiles(CFileTransfer& aTransfer,CPtrCArray& aFilelist)
{
CDesCArray* uploadnames= new (ELeave) CDesCArrayFlat(4);
TFileTransferCapabilities caps=aTransfer.Capabilities();
//uploadnames->Reset();
TInt ptr=0;
TInt count=aFilelist.Count();
if (count==0)
return;
while(ptr<count)
{
if (caps.iHandleMultipleUploads)
{
uploadnames->AppendL(aFilelist[ptr]);
}
else if (ptr==0)
uploadnames->AppendL(aFilelist[ptr]);
ptr++;
}
//uploadnames->AppendL(_L("test.scr");
test.Next(_L("Sending files ");
test.Printf(_L("Start the receiver program to be tested and press any key when
ready..");
test.Getch();
test.Printf(_L("\n");
CTransferTracker* tracker=new(ELeave) CTransferTracker;
TCallBack callBackEnd(FuncCallbackEnd);
aTransfer.UpLoad(callBackEnd,KCommsUploadDirectory,*uploadnames,tracker);
TheScheduler->Start();
TInt status=aTransfer.iStatus.Int();
test(status==KErrNone | status==KErrCancel);
delete(tracker);
}
RE: how to get a file via ftp/http?
2001-12-05, 14:59#3
you need to tell people on the post reply page that they can use
Code:
code
tags. That is the word "code" in between []. Then the word "/code" inbetween []. ie. the same ones from phpBB. Makes code alot easier to read, keeps all the tabbing etc.
I searching desesparatly how to implement a small ftp (Series 60) in my app and I have tried your stuff of code but I'm unable to link it, which library must I use for the CFileTransfer and CTransferTracker
No I am having the same problem as Jeepy:
I downloaded a Crystal V6.0 SDK, which contains the comftp.h.
But which library must i use to link successfully ? Has anybody actually used this comftp.h swith success for 3650 devices ?
I have found the solution for the libraries *BUT* the problem doesn't seem to come from there, in fact, the Series 60 don't have the necessary dll associated with comftp.h (for myself ...)
thanks to Nokia !!