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.
I just wanted to say thanks, and yeah it does work, but I sure wished it would explain “how” a little better.
You can put all of the import statements into a separate “library” file so it does not bulk up the main file.
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?
check out dynamic C manual
File compression with #zimport(), perhaps?
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.
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.
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.