- Thu Feb 12, 2015 1:45 pm
#9569
lethe wrote:You could simply convert a hexdump of your file to a char array, like: Code: Select allchar file[] = { 0xDE, 0xAD, 0xBE, 0xEF };
This will of course make your header file larger, but you won't need to decode the file on the ESP and the file won't take more space than necessary on the ESPs flash.
wouldn't I still need to do somekind of hex convertion on the data before I sent it to the browser?
ok here is what I am trying to do: (from unix)
gzip test.html
base64 test.html.gz > test.b64
echo "ICACHE_FLASH_ATTR char html[] = {" > tmp
cat test.b64 >> tmp
echo "}" >>tmp
mv tmp html.h
include the html.h into my program and send the data using the http protocol. I am hoping that I will not have to decode base64 on the esp8266 ... Instead pass it along to the (client) browser to handel ... using http1.1 headers we should be able to pass the data "as is" to the client using these http headers ...
Content-type: text/html
Content-encoding: gzip
Content-transfer-encoding: base64
However non of this has been fully tested ... YET!