How can I package html data (html text, images, etc) in PHP so a client can access it (iOS, Android) -


i'm building api in php accesses mysql database, stores series of articles, containing html-formatted text , images. able echo html device using http request, , although images display (linked img src) doesn't download html , images in 1 package. want archive articles individually nice download separately. i'm considering zipping php , downloading client app, i'm not sure. advice appreciated.

you try data uri scheme. allows encode image file directly html code.

<img src="data:image/png;base64,ivborw0kggoaaaansuheugaaaauaaaafcayaaacnbyblaaaaheleqvqi12p4//8/w38giaxdibke0dhxgljnbaao9txl0y4ohwaaaabjru5erkjggg==" alt="red dot" /> 

that example taken this wikipedia article, provides php example. it's easy do.

the caveat browser support sounds modern browsers, including mobile, should support it. give go , see, should take no time implement , you'll know right away if it's right solution.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -