You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.
Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.
//Code to save the image when arrive to server
// Take what you receive in UTF8 from the POST and...
$new_image = chunk_split(base64_encode($my_image));
$query = "INSERT INTO my_table (Image) VALUES ('$my_image')";
//Remember to define LONGBLOB (or what you need) the column my_table
//Code to retrieve image from the server
//Query the MySQL to retrieve what you saved before and send as answer under JSON if is an array or in normal if 1 data
$ANSWER = json_encode($my_datas);
$ANSWER = $my_datas;
//Here is your choice to choose to echo or use the AGK... hmmm i don't know, but i think you already done some test with normal text
//Creating the image from data
//Imagine you get XML or JSON UTF8 data from the request (REQUEST_RESULT)
//If you don't need JSON or XML you can manage the data as they arrive
NSData *_temp_image = [NSData dataWithBase64EncodedString:[NSString stringWithUTF8String: getStringFromWChar(JSON::decode(REQUEST_RESULT)]];
//You need a JSON parser (as i done my own one, cause the Apple one is not very good)
UIImage *_im = [UIImage imageWithData:_temp_image];
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:[imageUrl path]];
NSData *image = [NSData dataWithContentsOfURL:saved_image.url];
Login to post a reply