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

  • Home
  • SEARCH
  • 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 6869575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:34:29+00:00 2026-05-27T03:34:29+00:00

I have an application where I am sending image data on server through ftp

  • 0

I have an application where I am sending image data on server through ftp and retrieving back in a functionality of preview. Now I am able to send the image on server,but while retrieving it back,I am getting following error in NSData and 0 bytes are fetched.

Error Domain=NSCocoaErrorDomain Code=256 “The operation couldn\u2019t be completed. (Cocoa error 256.)”

I am parsing data through XML and fetching the image url like this

http://111.222.333.44/abc/images/User/img102-13.png

Now,when I use the following code to retrieve imgstr to nsdata, but getting the above error in the same.

 NSURL *u = [NSURL URLWithString:imgstr];
 NSError *error;
 NSData *dt = [NSData dataWithContentsOfURL:u options:NSDataReadingMapped error:&error];
 myImage = [UIImage imageWithData:dt];

I am able to fetch other data easily,but not the image data. Can anybody point out,where I am doing mistake or how I can resolve the problem? Thanks in advanced.

EDIT :
In my application I am first of all capturing an image and storing it on the server. And then on the 2nd page,I need to fetch the image data and to show the same image when the user clicks a button called Preview. I am having a web service where I am getting the data including the path of the image as shown above,but with the method shown I am not able to fetch the Image data in NSData and getting the Cocoa error 256. Hope this help someone to show me a better and correct Path. Thanks.

  • 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-05-27T03:34:30+00:00Added an answer on May 27, 2026 at 3:34 am

    I think the problem with this approach is that it will block the UI thread until the image is downloaded.

    try to load that image in separate thread.

    Well i tried your code and i too have a webService that takes the image from a url.

    instead of doing the above code. you can directly do
    try this:

        NSURL *u=[NSURL URLWithString:imgstr];
        UIImage *image1 = [UIImage imageWithData:[NSData dataWithContentsOfURL:u]];
    

    In my case its working.

    If you are still struck then the below link might help you:

    http://blog.beefyapps.com/2010/03/coredata-sqlite3-database-constraint-failed-error/

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

Sidebar

Related Questions

We have a mobile Application in a very unsteady WLan Environment. Sending Data to
I have a C++ application which communicates with a camera and fetches raw image-data.
I want to send an embedded email from my application. I have it sending
Will be sending out e-mails from an application on a scheduled basis. I have
I've have an application with Android front end and Django as the back end.
I am trying to send an image from a Java desktop application to a
I have an application which requires sending sms from one user to another.On receiving
I have an application bound to eth0, sending UDP packets on port A to
We have an application built on top of SQL server 2005 that we have
I'm sending an image file from an iPhone application to a http Post application.

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.