如何从ios中的iphone应用程序将Sqlite数据库文件上传到服务器 [英] how to upload Sqlite database file to server from iphone application in ios
问题描述
在我的iPhone应用程序中,我使用sqlite3创建数据库.现在,我想备份服务器上的数据库文件.
那么如何将我的sqlite db文件从iPhone中的应用程序上传到服务器?
我将把sql数据库读入JSON对象,然后通过URL将该URL上传到服务器,该URL沿 有关Apple开发人员文档中JSON负载的更多信息,请参见 NSJSONSerialization类参考以及Twitter示例应用程序. 我过去在iOS SBJson 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? 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: 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 这篇关于如何从ios中的iphone应用程序将Sqlite数据库文件上传到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!{database:{"col1":"56","col2":"85","col3":"some_text"},
{"col1":"57","col2":"86","col3":"next row"} }