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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:38:45+00:00 2026-05-26T21:38:45+00:00

I got stuck something annoying. I uploaded images to server it’s ok. However, when

  • 0

I got stuck something annoying.

I uploaded images to server it’s ok.
However, when i try to download image from server i want to get image with string variable. here is my php code server side

         ....

        echo "image_getting;";
        $fullPath = $_POST['download_image'];
        echo file_get_contents($fullPath);

         ....

if i remove first line from my server [request responseData] working correctly.
However, i want to also get “image_getting;” because i am also downloading some different types.

if i can clear, iphone side
when i say

- (void)requestFinished:(ASIHTTPRequest *)request
{
    NSString *responseString = [request responseString];
    NSLog(@"%@",responseString);

    NSArray *resultResponseArray = [responseString componentsSeparatedByString:@";"];
    if([[resultResponseArray objectAtIndex:0] isEqualToString:@"image_getting"])
    {
          NSData *responseData = [request responseData];
          UIImage * image = [UIImage imageWithData:aData];
          .......
    }
    else if...
....
}

as you can see above response data also taking echo “image_getting” how do i split it.
I tried to convert and split them it didn’t work.

I should say, i am very bad with php.

I will be appreciated, if someone help me.
Thanks

EDIT:Solution Php side

    header('X-Return: image_getting;');
    $fullPath = $_POST['download_image'];
    echo file_get_contents($fullPath);

iphone side

    NSLog(@"header %@",[[request responseHeaders] objectForKey:@"X-Return"]);
  • 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-26T21:38:46+00:00Added an answer on May 26, 2026 at 9:38 pm

    Why don’t you put the “image_getting” into a HTTP header in the response instead? That would make the parsing much easier – you can then retrieve the header:

    NSString *whatever = [[request responseHeaders] objectForKey:@"X-Whatever"];
    

    and then [request responseData] will only contain the image.

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

Sidebar

Related Questions

I'm trying to self-teach myself C++, and once again I got stuck on something
I'm porting some code from lisp, but I got stuck at this part (apparently
I'm learning MVVM through a project and I got stuck on something simple. I
I try to get this code running. I am almost there but I got
i got stuck while implementing one webservice in iPhone, i think something is wrong
I got stuck in a programming task. I want the elements of my stl
Decided to learn ASP.NET MVC and instantly got stuck on something simple. In Web
I got stuck among the weared behaviour of browsers. Ihave a div which has
I got stuck again between browsers compatability issues, what I was trying todo is
I got stuck in this problem for an hour. I am thinking this is

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.