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

  • Home
  • SEARCH
  • 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 6251563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:38:13+00:00 2026-05-24T13:38:13+00:00

I am building a native iPhone application where I have the File Upload functionality.

  • 0

I am building a native iPhone application where I have the File Upload functionality. I need to verify and confirm if the file was uploaded completely. How can I achieve this? My server side script to accept the file data and write/create the file on the server is built in PHP.

So I am trying to do 2 things:
1. Calculate the checksum of the file from iPhone and post it to PHP script
2. Once the PHP script creates the file on the server, recalculate the checksum and compare it with the posted value.

My Query here:
I am using MD5 to calculate the checksum but the values returned by objective c and PHP script are different?

Which is the best way I can calculate the checksum on iPhone? which can be matched on the server side.

Please suggest. Thanks

  • 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-24T13:38:14+00:00Added an answer on May 24, 2026 at 1:38 pm

    Here’s a code snippet I always use for md5sums:

        - (NSString *) md5:(NSString *) input
    {
        const char *cStr = [input UTF8String];
        unsigned char digest[16];
        CC_MD5( cStr, strlen(cStr), digest ); // This is the md5 call
    
        NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
    
        for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
            [output appendFormat:@"%02x", digest[i]];
    
        return  output;
    
    }
    

    Check out ASIFormDataRequest here http://allseeing-i.com/ASIHTTPRequest/How-to-use
    It’s a very helpful wrapper for this kind of operation. Below my codesnippet for uploading a file and md5sum:

    ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:[NSURL URLWithString: uploadUrl]] autorelease];
        [request setPostValue:md5sum forKey:@"md5sum"];
        [request setFile:[[NSURL URLWithString:filename] path] forKey:@"file"];
        [request startSynchronous];
    

    Make sure that you check serverside if everything is ok (md5sums match and file was uploaded ok). Then evaluate your server’s response with [request responseString] and take appropriate action.

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

Sidebar

Related Questions

I am currently in the process of building a native Google Reader iPhone application
I'm building a iPhone Web Application and want to lock the orientation to portrait
I have the following error during sqlite3-ruby install: Building native extensions. This could take
Would I expect to see any performance gain by building my native C++ Client
I'm building a project along with a Dll. The Dll must support native code
Building a client-side swing application what should be notified on a bus (application-wide message
When building some of my PHP apps, a lot of the functionality could be
I'm working on building an iPhone app with Titanium Mobile 1.0 and I see
I am building a custom camera app, and would like to have the camera
sudo env ARCHFLAGS=-arch x86_64 gem install do_sqlite3 Building native extensions. This could take a

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.