<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using httpsrv to access web pages on SDcard in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261139#M7774</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please share source code of your application with me? Problem might be with alias definitions. It should look like this:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;HTTPSRV_ALIAS http_aliases[] = {&amp;nbsp;&amp;nbsp;&amp;nbsp; {"/usb/", "c:\\"},&amp;nbsp;&amp;nbsp;&amp;nbsp; {NULL, NULL}&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First variable ("/usb/") is part of URI which will be replaced by second variable ("c:\\") when server looks for a file in filesystem. Also please &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;note the backslashes and make sure you have set them in same way.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Karel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Nov 2013 12:48:33 GMT</pubDate>
    <dc:creator>karelm_</dc:creator>
    <dc:date>2013-11-06T12:48:33Z</dc:date>
    <item>
      <title>Using httpsrv to access web pages on SDcard</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261138#M7773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My project is based on the Quick Start Demo for the K60 where it used the httpd web server framework and accesses web pages in the SDcard which worked fine.&amp;nbsp; I updated my project using the httpsrv framework from the httpsrv example project and everything works fine (serving web pages from flash is good) but any web pages on the SDcard come up as 404 Page Not Found.&amp;nbsp; I see there is a root directory alias structure HTTPD_ROOT_DIR_STRUCT root_dir[] in the httpd web server which I have changed to const HTTPSRV_ALIAS http_aliases[] and kept the contents of the structure the same.&amp;nbsp; There's also a function to check if the SDcard is installed with a signature static void sdcard_status_fn(HTTPD_SESSION_STRUCT *session) which I have changed to static _mqx_int sdcard_status_fn(HTTPSRV_SSI_PARAM_STRUCT* param).&amp;nbsp; I think I've got this function coded fine and everything compiles fine, just web pages on the SDcard come up as 404 Page Not Found.&amp;nbsp; Anything else I'm missing using the httpsrv framework and accessing web pages on the SDcard?&amp;nbsp; &lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gene&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 03:13:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261138#M7773</guid>
      <dc:creator>GeneGoff</dc:creator>
      <dc:date>2013-11-06T03:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using httpsrv to access web pages on SDcard</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261139#M7774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please share source code of your application with me? Problem might be with alias definitions. It should look like this:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;HTTPSRV_ALIAS http_aliases[] = {&amp;nbsp;&amp;nbsp;&amp;nbsp; {"/usb/", "c:\\"},&amp;nbsp;&amp;nbsp;&amp;nbsp; {NULL, NULL}&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First variable ("/usb/") is part of URI which will be replaced by second variable ("c:\\") when server looks for a file in filesystem. Also please &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;note the backslashes and make sure you have set them in same way.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Karel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 12:48:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261139#M7774</guid>
      <dc:creator>karelm_</dc:creator>
      <dc:date>2013-11-06T12:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using httpsrv to access web pages on SDcard</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261140#M7775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Karel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The alias definition you gave works for the web-hvac project, where web pages are stored on a USB stick.&amp;nbsp; In the K60 Quick Start Demo, the web pages are stored on the SDcard which is very similar, yet may have slight differences because it connects through the SD driver rather than the USB stack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code, which is identical to the working Quick Start Demo code, but with HTTPD_ROOT_DIR_STRUCT root_dir[] replaced with HTTPSRV_ALIAS http_aliases[].&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;const HTTPSRV_ALIAS http_aliases[] = { &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { "", "tfs:" },&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Internal flash with Trivial File System&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { "sdcard", "a:" }, //SDCard as a: partition drive&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 0, 0 }&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried { "/sdcard/", "a:\\" } but still got 404 Page Not Found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 15:16:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261140#M7775</guid>
      <dc:creator>GeneGoff</dc:creator>
      <dc:date>2013-11-06T15:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Using httpsrv to access web pages on SDcard</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261141#M7776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gene,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just to be sure. You are accessing webpages on sdcard from your browser through URL that looks like this:&lt;CODE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://BOARD_IP_ADDRESS/sdcard/WEB_PAGE_NAME.html"&gt;http://BOARD_IP_ADDRESS/sdcard/WEB_PAGE_NAME.html&lt;/A&gt;&lt;/CODE&gt;? And this sdcard is mounted as disk "a:" in your configuration, right? If that is true, then your aliases should look like this:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;const HTTPSRV_ALIAS http_aliases[] = {{ "/sdcard/", "a:\\" },{ NULL, NULL }};&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Karel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 15:24:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261141#M7776</guid>
      <dc:creator>karelm_</dc:creator>
      <dc:date>2013-11-06T15:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Using httpsrv to access web pages on SDcard</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261142#M7777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are correct.&amp;nbsp; I added your alias entry and I had to remove the alias { "", "tfs:" } and everything works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Karel!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 03:43:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261142#M7777</guid>
      <dc:creator>GeneGoff</dc:creator>
      <dc:date>2013-11-07T03:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Using httpsrv to access web pages on SDcard</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261143#M7778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad it works for you :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Karel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 08:22:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-httpsrv-to-access-web-pages-on-SDcard/m-p/261143#M7778</guid>
      <dc:creator>karelm_</dc:creator>
      <dc:date>2013-11-07T08:22:28Z</dc:date>
    </item>
  </channel>
</rss>

