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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:58:43+00:00 2026-05-27T06:58:43+00:00

I am passing base64 encoded image string to the server side with the HTTP

  • 0

I am passing base64 encoded image string to the server side with the HTTP PUT method.I have tried several times but getting error message as response. That error message is because null value is getting in the server side. I have checked the same, in android code and its working fine there. I am attaching my code below.

SBJSON *parser = [[SBJSON alloc] init];
NSString *url=[NSString stringWithFormat:@"The URL i am using"] ;   
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];      
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setValue:@"XXXXX" forHTTPHeaderField:@"USER_AGENT"];

[request setHTTPMethod:@"PUT"]; 
NSString *input=[NSString stringWithFormat:@"abc[image]=%@",base64encodedString];
[request setHTTPBody:[input dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]];

NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];    
NSString *json_string = [[NSString alloc] initWithData:response encoding:NSASCIIStringEncoding];        
NSDictionary *statuses = [parser objectWithString:json_string error:nil];       
[parser release];

[json_string release];  
return statuses;

I am getting error message from the server side like this: “xxxxxx.jpg is not recognized by the ‘identify’ command.”

Kindly suggest a solution.

At last i found that the content type should be changed to “multipart/form-data” from “application/x-www-form-urlencoded”. Can anyone please tell me how pass Base encoded string using this way? Pls…i am behind this issue for the last 20 days…

  • 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-27T06:58:43+00:00Added an answer on May 27, 2026 at 6:58 am

    There could be a difference in the Base64 routine. Base64 encode the same data on the server and the iPhone and compare.

    Using the simulator use a network snooper such as Wireshark on the Mac to see what is really going out and the full return from the server. If you are using SSL you can use the Mac app Charles to see the data.

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

Sidebar

Related Questions

I'm passing raw HTTP requests to an apache server (received by PHP). The request
I need to send a base64 encoded string to a client. Therefore, I'm opening
Passing messages around with actors is great. But I would like to have even
Passing data (simple string) from Controller to View I have in my controller: public
I'm passing a bool from one form to another, I have tried declaring 'Private
I am passing post data to a website, but I have to visit the
I have an issue.. I am passing the image as the parameter to my
I have to issues: 1) I've tried using JsonP, but can't get POSTing to
Whether passing a base64 encoded username and passwords as variables through a secured SSL
I have an image on a web page constructed like so: <img src=data:image/png;base64;.... />

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.