# RCM4300 w/Rabbitweb - image support?

**URL:** <https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776>\
**Category:** Rabbit\
**Created:** [March 24, 2008, 7:20pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776 "2008-03-24T19:20:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pm1759](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pm1759](https://forums.digi.com/u/pm1759)\
**Post date:** [March 24, 2008, 7:20pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/1 "2008-03-24T19:20:07Z")

</div>

Hi, I am developing a web-based GUI using the RCM4300 w/Rabbitweb. I was hoping to create dynamic menus with JavaScript-like functionality, perhaps much like DHTML or HTML DOM. My questions:

Can RabbitWeb support HTML with frames, JavaScript, and CSS?  
Is what I am asking possible?  
If it is, how are the images handled?

Reading over the manuals it seems like it should be possible, however it is quite vague.

---

<div class="post-metadata">

**Author:** ![aturichshev](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@aturichshev](https://forums.digi.com/u/aturichshev)\
**Post date:** [March 25, 2008, 5:55pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/2 "2008-03-25T17:55:43Z")

</div>

Hi,

Everything you are asking for can be done with RCM4300 and RabbitWeb. Actually, frames, JavaScript, and CSS support has nothing to do with RabbitWeb but with a browser. RabbitWeb will be happy to feed the browser anything… it is up to the browser to “make sense” of it all.

---

<div class="post-metadata">

**Author:** ![pm1759](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pm1759](https://forums.digi.com/u/pm1759)\
**Post date:** [April 19, 2008, 10:00am UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/3 "2008-04-19T10:00:57Z")

</div>

I just wanted to say thanks, and yeah it does work, but I sure wished it would explain “how” a little better.

Using sample programs and more than a few hours of headache I figured out you simply #include the .html, javascript, images, etc. and then set things up in the MIME tables to handle the files. I have quite a long, long list of them so it does bulk up my code a lot, but it works.

---

<div class="post-metadata">

**Author:** ![aturichshev](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@aturichshev](https://forums.digi.com/u/aturichshev)\
**Post date:** [April 19, 2008, 2:05pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/4 "2008-04-19T14:05:54Z")

</div>

You can put all of the import statements into a separate “library” file so it does not bulk up the main file.

---

<div class="post-metadata">

**Author:** ![pm1759](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pm1759](https://forums.digi.com/u/pm1759)\
**Post date:** [April 19, 2008, 7:09pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/5 "2008-04-19T19:09:15Z")

</div>

How does that work? I have yet to run up on the code for that. I’m assuming it’s like creating a library in C?

---

<div class="post-metadata">

**Author:** ![aturichshev](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@aturichshev](https://forums.digi.com/u/aturichshev)\
**Post date:** [April 19, 2008, 9:55pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/6 "2008-04-19T21:55:56Z")

</div>

check out dynamic C manual

---

<div class="post-metadata">

**Author:** ![pm1759](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pm1759](https://forums.digi.com/u/pm1759)\
**Post date:** [April 20, 2008, 12:42pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/7 "2008-04-20T12:42:10Z")

</div>

File compression with #zimport(), perhaps?

---

<div class="post-metadata">

**Author:** ![bsprouse](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@bsprouse](https://forums.digi.com/u/bsprouse)\
**Post date:** [April 21, 2008, 9:46pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/8 "2008-04-21T21:46:29Z")

</div>

All of the functionality you mentioned is really outside the Rabbit server, as all of these are just files to the server. Is your question more about where to put the files to make them available on the Rabbit based server?

If so, look at SSI.c or SSI2\_FAT.c sample programs. SSI shows how to ximport files into code space on the Rabbit and make them available, as well as setting up dynamic data connections to the web pages. The SSI2\_FAT sample is basically the same, but with the files now stored on the FAT filesystem, which would allow you to use either NAND or SD based flash for storing your website.

---

<div class="post-metadata">

**Author:** ![pm1759](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@pm1759](https://forums.digi.com/u/pm1759)\
**Post date:** [April 27, 2008, 8:23am UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/9 "2008-04-27T08:23:32Z")

</div>

Thanks a lot for the suggestion bsprouse, in fact I’ve been looking for just that functionality in order to keep the server functioning correctly through power cycles… at least a little more robust than the on-board Flash.

however, I’ve run into a rather serious problem with the FAT\_SETUP.c file, which is THE file to load the website code/images into SD-Flash. The original sample works, and I’m trying to load literally anything else than the sample information in my large partition (set up in sdflash\_inspect.c), and it comes back with these types of errors:

> Copying from /source.ssi to /A/source.ssi…  
> …done (copied 290 bytes into preallocation of 290) //this works, next are errors in stdio…
> 
> Copying from /frames.zhtml to /A/frames.zhtml…  
> Could not open /A/frames.zhtml for writing, rc=-306  
> …  
> Copying from /frame\_back2.zhtml to /A/frame\_back2.zhtml…  
> Could not open /A/frame\_back2.zhtml for writing, rc=-22  
> …  
> Copying from /I/bhomeon.png to /A/I/bhomeon.png…  
> Could not open /A/I/bhomeon.png for writing, rc=-2

I just don’t understand why I’m getting negative numbers other than perhaps some sort of .zhtml or .png file extension which isn’t included with the loading function. All these files are under 20K, and the.zhtml is under 10K, so it seems like they’d be OK…

Edit: it doesn’t happen on the read, it only happens on the write. And yes, I am literally just adding these files in the three correct spots in the code, and these files I’m trying to load are co-located with the files which actually work.

---

<div class="post-metadata">

**Author:** ![bsprouse](https://avatars.discourse-cdn.com/v4/letter/b/ecd19e/32.png) [@bsprouse](https://forums.digi.com/u/bsprouse)\
**Post date:** [April 30, 2008, 8:10pm UTC](https://forums.digi.com/t/rcm4300-w-rabbitweb-image-support/10776/10 "2008-04-30T20:10:26Z")

</div>

The FAT filesystem uses the 8.3 file naming convention. The .zhtml extension needs to be shortened to .htm or .zht or something similar, although I believe htm is the common 3 character extension used for this type of file. The .png file failed as you tried to write it to a directory you most likely hadn’t created yet. A\I.… indicates the use of a subdirectory name ‘I’ that needs to be created before files can be written to it. Directory creation is not automatic, so if you need a directory tree structure for your files, it is best to lay it out and create the tree before running FTP code to access it. You can use the fat\_shell sample to create your directory structure as it provides an OS like interface that has both CD (change directory) and MKDIR (make directory) commands available. The error numbers you received can be decoded by looking at the errno.lib library file or using the error\_message(error\_code) function which returns a short string description of the error.
