locked
FTP download in background transfer

    Question

  • Hi,

    I am using the following code ( background transfer) to download from an ftp server:

     task<StorageFile^>(folder->CreateFileAsync(file_name, CreationCollisionOption::ReplaceExisting))
     .then([this](StorageFile^ file)
     {
      BackgroundDownloader^  bd = ref new BackgroundDownloader( );
      if( bd )
      {
       DownloadOperation^ loader_op = bd->CreateDownload( ref new Uri(FTPUrl), file );
       if( loader_op )
       {
        IAsyncOperationWithProgress<DownloadOperation^, DownloadOperation^>^ async;
        async = loader_op->StartAsync();
        if( async )
        {
         task<DownloadOperation^>(async, CancellationToken->get_token()).then([this] (DownloadOperation^ download)
         {
          ResponseInformation^ response = download->GetResponseInformation();
          if( 200 == response->StatusCode )
          {
             // download complete
          }
          else
          {
     
          }

         }).then([this, loader_op] (task<void> previousTask)
         {
          try
          {
           previousTask.get();
          }
          catch (Exception^ ex)
          {
          }
         });
        }
       }

      }

     });

    But after a short while the code throws exception with the following error:

    "Unnhandled exception at 0x50B38AE3 (msvcr110d.dll) in Download.exe: An invalid parameter was passed to a function that considers invalid parameters fatal." The error is in the file invarg.c . I have attached a screenshot of the exact place in this file where the error occurs:

    I had posted a similar question regarding this previously and was informed that there was a bug in Release Preview in FTP download. Any fixes? The above code works fine with http server.

    I hope there is a fix to this according to the last reply to the below thread :

    http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/382be788-b2e0-4aef-b6dc-ed6305235f5e


    • Edited by its_me_here Monday, August 13, 2012 2:15 PM
    Monday, August 13, 2012 2:14 PM

All replies

  • Hello,

    It looks like you have stumbled on a new issue. We are currently tracking this internally. I have contacted the team responsible for the component. If I hear anything interesting from them I will let you know.

    Thanks,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, August 15, 2012 12:43 AM
    Moderator