This is a group for folks designing and programming embedded systems using the Rabbit Semiconductor C-programmable microcontroller. Rabbit Semi is a spin-off from Z-World who makes a variety of embedded modules and tools. This group is not affiliated with either Rabbit or Z-World, but is a user forum for sharing ideas, asking questions,
flaunting knowledge, and other typical user group stuff. The Rabbit is a powerful uC, supported by a full-featured C-compiler.
Hi,
I've got a minor problem, but it's bugging me... so I'd appreciate it
if someone could point me in the right direction. I've got a Rabbit
that logs data and outputs it to a web page (most of the code is based
on the nflash_log.c sample). To keep the page from loading too long,
I have it only load the most recent data with buttons to navigate to
older data.
It would also be nice to be able to be able to download all the data
at once as a text file for processing rather than viewing. I added
that by basically copying the printlog_cgi function, except mapping it
to a .txt file instead of .cgi file in the http_flashspec array, and
getting rid of the HTML header/footer. Then in the http_types array,
I set { ".txt", "text/plain", NULL}. The problem I have is that IE
always tries to download it as HTML and not plain text. Clicking it
opens it up as HTML, and right click->save as tries to download as
HTML. The odd thing is if I open it up, and then refresh, doing
file->save as defaults to text file.
If I #ximport a real .txt file it downloads as a text file like it
should. I haven't tried Firefox yet, but I will tomorrow, but it
seems like I'm not doing something correctly to map this to
"text/plain". I also tried
in the link, and
also "application/octet-stream" (hoping to force it to do save as by
just clicking the link), but nothing seemed to make a difference.
Do I need to do something differently because it's a HTTPSPEC_FUNCTION
and not a HTTPSPEC_FILE? Or is there something else I'm doing wrong?
The data comes through fine, but it's just annoying that I have to
rename it from .htm to .txt every time.
Thanks,
Pat
------------------------------------

(You need to be a member of rabbit-semi -- send a blank email to rabbit-semi-subscribe@yahoogroups.com )