3

In my iphone application i used sqlite3 for creating database. Now i want to take backup of a database file on my server.

so how to upload my sqlite db file to server from my application in iphone?

1 Answer 1

5

I would read the sql database into a JSON object, then upload it to a server via a URL that calls a PHP script along the lines of this stack overflow answer!

Here's an example of some mySQL data wrapped into JSON:

{database:{"col1":"56","col2":"85","col3":"some_text"},
{"col1":"57","col2":"86","col3":"next row"} }

More about JSON payloads in Apple dev docs here JSON

As of iOS5.x, Apple now includes some JSON helper classes, see NSJSONSerialization class reference along with the Twitter example app.

I have used this the SBJson framework in the past for iOS SBJson

Sign up to request clarification or add additional context in comments.

2 Comments

hello nick thanks for your reply.Instead of read sql database into a JSON object. I want to upload whole Sqlite db file similar to the upload image on server in iphone. It is possible or not.
One option is to turn on file sharing via iTunes: See stackoverflow.com/questions/10241032/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.