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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:08:06+00:00 2026-05-23T10:08:06+00:00

For several days, I look for what’s wrong in my code but without success,

  • 0

For several days, I look for what’s wrong in my code but without success, and now I really want to know what’s wrong.
The problem is that I want to send an UIImage from my Iphone to my server, but I receive a blank image on my server everytime… I’m not sure, but I think the problem come from the image that I convert. The UIImage come from the method takePicture.
Please check my code :

First I call takePicture and :

- (void)imagePickerController:(UIImagePickerController *)aPicker didFinishPickingMediaWithInfo:(NSDictionary *)info {
self.testImage = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
}

testImage is a property of my ViewController.
Then I make this to send the UIImage :

NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(testImage)];
NSURL *url = [NSURL URLWithString:@"http://myserver/mytest.php"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request addData:imageData withFileName:@"tmp.png" andContentType:@"image/png" forKey:@"userfile"];
[request setRequestMethod:@"POST"];
[request setDelegate:self];
[request startAsynchronous];

and to see the result :

- (void)requestFinished:(ASIHTTPRequest *)request
{
// Use when fetching text data
NSString *responseString = [request responseString];
NSLog(@"response: %@", responseString);

// Use when fetching binary data
NSData *responseData = [request responseData];
}

- (void)requestFailed:(ASIHTTPRequest *)request
{
NSError *error = [request error];
    NSLog(@"Request Failed Error: %@", error);
}

and then I receive a blank image on my server…
Please help me ='(

  • 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-23T10:08:06+00:00Added an answer on May 23, 2026 at 10:08 am

    The issue came from the high resolution image. My connection was too slow. When I’m using wifi the code works.

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

Sidebar

Related Questions

I've been hacking at a problem on and off for several days now that
There are several days that I look for a solution of my problem :
I've been working in ASP.NET for several years now (since the 1.0 days!), but
I've spent several days attempting to resolve this issue without success. The issue is
I've been in a dilemma for several days and now I'd really appreciate your
I'm struggling with this for several days now. I want to create a functions
It's been several days that I got deadlock issues on a Java application with
I need to create a single trace file that spans several days for one
I have several workflows where the users want to set the number of days
I've been working on this for a few days now, and I've found several

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.