×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    12

    how to get a file via ftp/http?

    Is there a way to get a file from a certain ftp/http site from within an application?

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    157

    RE: how to get a file via ftp/http?

    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&quot);
    test.Next(_L("Sending files &quot);
    test.Printf(_L("Start the receiver program to be tested and press any key when
    ready..&quot);
    test.Getch();
    test.Printf(_L("\n&quot);
    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);
    }

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    157

    RE: how to get a file via ftp/http?

    Semi colons are showing up as smiley faces (Annoying isn't it) That problem should be fixed shortly.

  4. #4
    Registered User
    Join Date
    May 2003
    Location
    London
    Posts
    40
    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.

    Dalore

  5. #5
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730
    OSXDev,

    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

    Thanks in advance,
    Dominique HUGO
    d.hugo@sage.be

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    7
    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 ?

  7. #7
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730
    rsaccon,

    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 !!

    Dominique HUGO
    d.hugo@sage.be

  8. #8
    Registered User
    Join Date
    May 2003
    Posts
    24

    Working example of HTTP POST

    I use this code to upload the contents of a file in an HTTP POST. Maybe it can help you?

    http://discussion.forum.nokia.com/fo...2798#post62798

  9. #9
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730
    Thanks oledocmeth, I'm going to try it ....

    Dominique HUGO
    www.gosymbian.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×