I'm working on STM32. I'm trying to build a web server based on STM32. First, I implement a file system on SPI flash and write it to the browser with LWIP Libraries. Everything work fine with a html file without any "src". Now i want to add images on web page which means i need to have images on my SPI flash as well. I guess i should format the image first before i store it? and if it is stored in SPI flash. how html use the image? anyone has idea about it?
if ((buflen >=5) && (strncmp(buf, "GET /", 5) == 0))
{
FileNodeId = Find_File_Node(WEBPAGE);
if(Load_File_Table() != VAT_SUCCESS) return VAT_UNKNOWN;
else{
for(int i = 1;i <= File_Table[FileNodeId].numSector;i++){
READSector(WEBPAGE,&webbuf[0],i);
int html_length=strlen(&webbuf[0]);
netconn_write(conn,&webbuf[0], html_length, NETCONN_COPY);
memset(&webbuf[0],0,4080);
}
}
netbuf_delete(inbuf);
}
This is how I write my html page to the web browser with LWIP Lib. And the html is stored in link listed flash file system.