Image corrupt or truncated
highplainsbubba
Posts: 34
I am trying to toggle the visibility of a red led jpg on my web page when the Spinneret led is told to turn on and off. The The web page works correctly when I am not tied to the Spinneret and am just testing the web page. When I connect to the Spinneret and toggle the led on and off, a generic icon appears and the error console says " Image corrupt or truncated" and the pop up says "The image "view source:http://192.168.1.200:5000/red led.jpg cannot be displayed because it contains errors." I remembered that the html files had to have a 8.3 format, so I changed the red led. jpg to that format with no help. I googled the error and found that it has to do with the file being in the wrong format ie a jpg should be a ico or png or vice versa. . Is there a limitation on the type of file (jpg,png,ico) that I can have on the SD card?
Comments
However, it sounds like you want to toggle an image when a link or button is clicked. There's a few way s to do this. What I would do... Use javascipt to set the image src attribute and let the browser do the HTTP get. I used the technique on the Multi-Socket tutorial when you click a link and the image downloads.
jvrproductions is right the error is coming from the browser html encoding the space in red leg.jpg. The error message is
The Spinneret receives the following resource request.
I did not HTML decode the resource request. Do not put spaces in the file name.
I'll look into decoding the whole request header line if you really need to have a space. I'm not sure how the SD card driver will react as I have never tried to open a file that contains a space.
Secondly, you HTML is not valid. It has to do with the opening and closing of the < div > tags.When I open your page the buttons shoot over to the upper left corner, one button on top of the other.