关于iphone:将png / pdf文件存储在sqlite中

Store png/pdf file in sqlite

本问题已经有最佳答案,请猛点这里访问。

Possible Duplicate:
Reading and writing images to an SQLite DB for iPhone use

如何在sqlite中存储pdf,png文件。

是否可以存储pdf和png文件?

请帮帮我。

如果您有任何想法,请与我分享。

谢谢您,


您可以将PDF或PNG文件存储在BLOB字段中。

首先创建表

1
create table Blubber ( PK int primary key , BITSINK blob );

然后使用插入添加数据。

1
2
insert into Blubber (PK,BITSINK)
values (1, 'your blob goes here, best to use bind variables though!');

告诉我们您使用哪种语言,以获取有关如何使用绑定变量的建议。

EDIT刚看到这是标记为iPhone,该语言将是适当的C语言(Objective C ??)


有一个BLOB数据类型,所以我想您可以:

http://www.sqlite.org/datatype3.html