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 8491277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:22:21+00:00 2026-06-10T22:22:21+00:00

I’m using ASIHTTP for download some documents from a server. I have a button

  • 0

I’m using ASIHTTP for download some documents from a server. I have a button that first control the differences between the local version (saved on iPad file system) and the server version and then (after a confirm alert view) starts the downloads.
To download the documents I use this code:

for (SyncNode *node in _syncDocuments) {
        //SyncNode is a my Class that handle document
        // start the download
        NSString *filename = [NSString stringWithFormat:@"%@.%@",node.uniqueIdentifier,node.extension];
        NSString *tempPath = [SavedDocument pathToSyncFile:filename];
        // tempPath is a string like this
        // /var/mobile/Applications/5C05AA6F-55B3-46FD-8330-094BD0E61973/Documents/SyncDocumentsFolder/D49B421C-7528-4A3D-A8F6-942FF03881D0/f2e650e2-cff7-4485-9152-5445bee436f2.jpg

        //BaseHTTPRequest is an extension of ASIHTTPRequest
        BaseHTTPRequest *request = [[[BaseHTTPRequest alloc] initWithURL:[NSURL URLWithString:node.contentLocation] accountUUID:_uuid] autorelease];
        request.userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:i+1] forKey:@"requestNumber"];
        [request setDelegate:self];
        [request setShowAccurateProgress:YES];
        [request setDownloadProgressDelegate:self];
        [request setDownloadDestinationPath:tempPath];

        [request startAsynchronous];
}

Scenario.

  1. I don’t have any local file stored on iPad
  2. I push the button and the routine calculate the size of the download
  3. I accept the download and a routine dowloads all documents. When I try to display one of this documents (in a web view) it works fine and I can see the document.
  4. I delete all local documents (the delete process works perfectly, in fact the documents exists on the file system).

Now, I’am in the same situation of 1. but when I try to dowload the same documents again (the second time) all ASIHTTPRequest return and call my - (void)requestFinished:(ASIHTTPRequest *)request method, in a very short time interval.
Example: I have a directory with 8MB of documents; the first time the routine needs 11 or 12 seconds to complete all download. Instead the second time the same routine, with the same documents needs less than 1 second to complete all downloads.

It’s seem that the download not run, but ASIHTTP doesn’t call any error delegate methods.

When I try to show a document downloaded (the second time) I see this error message in the console:

   Error copying file to temp path Error Domain=NSCocoaErrorDomain Code=260 "The operation
 couldn’t be completed. (Cocoa error 260.)" UserInfo=0x1229e900 
{NSFilePath=/var/mobile/Applications/5C05AA6F-55B3-46FD-8330-
094BD0E61973/Documents/SyncDocumentsFolder/D49B421C-7528-4A3D-A8F6-942FF03881D0/f2e650e2-cff7-
4485-9152-5445bee436f2.jpg, NSUnderlyingError=0x1229e570 "The operation couldn’t be completed. 
No such file or directory"}

This problem drive me crazy !
Any ideas ?

  • 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-10T22:22:24+00:00Added an answer on June 10, 2026 at 10:22 pm

    Try to set a cache policy for your request using setCachePolicy propery.

    [request setCachePolicy:(ASIDoNotReadFromCacheCachePolicy | ASIDoNotWriteToCacheCachePolicy)];
    

    For more informations read this: http://allseeing-i.com/ASIHTTPRequest/How-to-use#using_a_download_cache

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in

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.