Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9111533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:31:44+00:00 2026-06-17T03:31:44+00:00

I am currently developing an iPad iOS 6 Application which uses async downloads. To

  • 0

I am currently developing an iPad iOS 6 Application which uses async downloads.
To receive progress information i used the delegate NSURLConnectionDownloadDelegate.
The download and the progress received by

– connection:didWriteData:totalBytesWritten:expectedTotalBytes:

works just fine.

However once the download is finished, i do not know how to extract the data out of the NSURL destinationURL provided by the delegatemethod

– connectionDidFinishDownloading:destinationURL:

The destinationURL received in String looks like
“/private/var/mobile/Applications/7CB3B194-9E79-4F0B-ACFD-7B87AA8C7BAF/tmp/filename.mp4“

Then i try to extract the data from the given NSURL:

NSData *data = [[NSData alloc] initWithContentsOfURL:destinationURL];

The data however is empty…

NSLog(@"data Size: %@", data.length);     //prints out 0

Has someone the same issue by using NSURLConnectionDownloadDelegate? Any ideas how to solve?


Edit: I tried to copy the file first, and then use [NSData initWithContentsOFFile] as suggested, but the data size is still 0.

- (void) connectionDidFinishDownloading:(NSURLConnection *)connection destinationURL:(NSURL *)destinationURL
{

[[NSFileManager defaultManager] copyItemAtPath:destinationURL.path toPath:DEST_PATH error:nil];

NSData *data = [[NSData alloc] initWithContentsOfFile:DEST_PATH];

NSLog(@"data Size: %i", data.length); //still returns 0..
}

Edit2:
I can extract the NSData when using sendAsynchronousRequest method of NSURLConnection. However like this, i am not able to determine the progress of the download…

[NSURLConnection sendAsynchronousRequest:theRequest queue:[[NSOperationQueue alloc] init] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error){
if (data){
NSLog(@"Size of the data: %i Bytes(s)", data.length); //works fine
[data writeToFile:DEST_PATH atomically:YES];
//From this point i can use the file at DEST_PATH

NSLog(@"Succeeded!");
}
else if (error)
NSLog(@"%@",error);
}];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:31:45+00:00Added an answer on June 17, 2026 at 3:31 am

    Check if the file exists.
    I have the same problem and I have to use NSURLConnectionDataDelegate and save the data manually and that’s why:
    There is an error with NSURLConnectionDownloadDelegate related with some file extensions.

    Also you could see answers to the same question here:
    NSURLConnectionDownloadDelegate file issue

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing iPad application which involve retrieving information from webservice and then
I'm currently developing an iOS application (iPad and iPhone) that uses OpenGL ES 1.0
Am currently developing an iPad app which uses a UIScrollView. The UIScrollView is populated
I am currently developing an application on iPad which connects to a client pc
I am developing an iPad application which is basically a big drawing canvas with
I'm currently developing an app for iPad. The development started for iOS 4.2 and
I'm currently developing an iPad application that integrates MapKit. But I have a small
I'm currently developing a small, JavaScript based drawing application on iPad. I've simply wrapped
I am currently developing an iPad application that has a Pause button. The entire
I am currently developing an iPad application. I want this to communicate with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.