×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Banglore,India
    Posts
    64

    weird problem when downloading file via HTTP.

    hi,
    I am downloading different media files via HTTP.
    the responce is received in chunks.I am appending all the responces and writing it to a file.

    my code looks like this,
    In MHFRunL()

    case THTTPEvent::EGotResponseBodyData:
    {
    MHTTPDataSupplier* body = aTransaction.Response().Body();

    TBool isLast = body->GetNextDataPart(dataChunk);
    RFile File;
    if(FirstChunkOfResponce)
    User::LeaveIfError(File.Replace(iFs,iFileName,EFileWrite));

    else
    User::LeaveIfError(File.Open(iFs,iFileName,EFileWrite));

    TInt pos = 0;
    File.Seek(ESeekEnd,pos);
    File.Write(dataChunk); //Responce is received in datachunk

    FirstChunkOfResponce = EFalse;

    File.Close();
    body->ReleaseData();
    }

    when I download an image file i.e.issue Get() request for the first time,I am able to display the image,if I issue Get() request for same file for the second time and onwards,I get unpredictable results.sometimes image is correctly downloaded and sometimes not.moreover,when I debug it,I never get this problem and image is correctly downloaded each time.In this case,I put breakpoint in IssueHttpGetL().I see that this function gets executed 3 times,I dont know why?

    more interesting thing is,my image size is 69.5KB,I never get a total responce of less than 69.5KB. whenever I get total responce of 69.5KB,139KB,208KB the image is correctly displayed.
    which happen to be multiple of image size.

    what can be the problem,perhaps when I am issuing Get() for second time onwards, I dont get responce from beginning.

  2. #2
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Banglore,India
    Posts
    64

    Re: weird problem when downloading file via HTTP.

    my mistake.
    I made a blunder in my offerkeyeventL()
    I forgot to put,

    if( aType == EEventKey )

    so after clicking msk, the corresponding function(GetL()) was getting called 3 times.now my problem is solved

Similar Threads

  1. problem when importing from carbide c++ to vs 2003!
    By misfit.physics in forum Symbian Tools & SDKs
    Replies: 12
    Last Post: 2008-02-19, 09:45
  2. Downloading a Binary File using HTTP GET
    By razas in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2007-08-31, 19:53
  3. Problem opening file from a dynamic path
    By didienGanteng in forum Symbian
    Replies: 12
    Last Post: 2007-06-27, 11:13
  4. Problem relating smil file!!!
    By symwarrior in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-12-21, 16:16
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

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