On Thu, 7 Jun 2012 02:10:44 +0000, YAN HONG YE <[email protected]>
wrote:
>
>sqlite3_exec(db,"create table image (filename varchar(128) unique,img
>blob);",0,0,&zErrMsg);
>and put image to my sqlite db:
>sqlite3_prepare(db,"insert into image values('mmmm.jpg',?);",-1,&stat,0);
>........
>I export the html use this command:
>sqlite3 -html film.db "select * from image;">my.html
>but I couldn't see the jpg in my web. why?
Bscause the -html option of the command line tool will only generate
<tr><td>mmmm.jpg</td><td>{blob contents here}</td></tr>
for you, which is not the html you need for images in web pages.
It is also not how http works.
The webpage which shows the image should contain an image tag:
<img src="mmmm.jpg" />
While loading the page, the webbrowser will then launch another request
for the image, and your webserver should be able to serve the image in a
separate response, with another mime-type.
It is possible to completely embed the image in the webpage (using
multipart responses), but you'll have to write a program that composes
the response. Or use a framework that handles it for you.
--
Regards,
Kees Nuyt
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users