Home/Support/Support Forum/HTTP server - image import
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

HTTP server - image import

0 votes

I'm using DIGI connect ME9210 (NET+OS) and sample app "HTTP CGI Server Sample".
I just need to modify the html file so that it will show an image when you access the device. I can successfully launch the HTML server, but I'm not able to display an image.

First in folder web->webcontents->html I place "mytest.html" as following:

<title>Test page</title>
<img src="images/logo.png"/>

Then under web->webcontents->html I create folder "images" where I place "logo.png".
Using PBuilder I generate the code, compile it and flash into the device. Everything successful.

However, when I access the device's HTTP server I see that the image has not been loaded.
So my question is how can I link the image with the http server? Where shall I place the image? Do I need to create any file system?

I will appreciate any suggestions.

Thank you
asked Jan 19, 2017 in NET+OS by stepik New to the Community (4 points)
edited Jan 18, 2017 by stepik

Please log in or register to answer this question.

1 Answer

0 votes
1. Have you added the image to the file list in PBUILDER.PBB?
2. I found I needed a capital 'I' for the images directory:
<img src="Images/logo.png"/>
answered Jan 20, 2017 by steved2 Seasoned Professional (183 points)

thanks. You are right. I just needed to put capital 'I':
<img src="Images/logo.png"/>
Then it worked fine.

I was wondering why is that and eventually I found if you run the PBuilder it creates a master object list (rpObjectDescriptionPtr gRpObjectList[]) in "RpPages.c" which includes descriptors of all objects you imported (images, html files, css files, ...).
If you than have a look at them, you can see paths where the objects are actually stored in ROM. For my image it was: "/Images/logo.png". Then you can update your .html file accordingly.