Image of loading iphone with variable using ASIHTTPRequest

I'm stuck with something annoying.

I uploaded the images to the server, this is normal. However, when I try to download an image from the server, I want to get the image with a string variable. here is my php code server side

         ....

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

         ....

if I delete the first line from my server [request responseData], working correctly. However, I also want to get "image_getting;" because I also download several different types.

if i can clean 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 the response data, also accepting the echo "image_getting" as I share it. I tried to convert and break them, but it did not work.

I have to say that I am very bad with php.

I would be grateful if someone would help me. Thanks

EDIT: Php

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

iphone

    NSLog(@"header %@",[[request responseHeaders] objectForKey:@"X-Return"]);
+2
1

"image_getting" HTTP- ? - :

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

[request responseData] .

+2

All Articles