mime type errors / problems

So I am trying to add in my own web page using the samples.c program.
I have 4 web page files to add.

#1) index.html
#2) test.swf
#3) playerProductInstall.swf
#4) AC_OETags.js

I was reading the TCP/IP User�s Manual Volume 2, in section “4.5.1.2 Adding Files with Different Extensions” on page 154.

so it tells me to go to “ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types” which is of course a dead link.
I do some googleing, and found the mime types.

I changed the Ximport to this:

#ximport “samples/tcpip/http/mypages/index.html” index_html
#ximport “samples/tcpip/http/mypages/test.swf” test_swf
#ximport “samples/tcpip/http/mypages/playerProductInstall.swf” PPI_swf
#ximport “samples/tcpip/http/mypages/AC_OETags.js” AC_OETags_js

Then I changed the Resource Table to this:

SSPEC_RESOURCETABLE_START
SSPEC_RESOURCE_XMEMFILE(“/index.html”, index_html),
SSPEC_RESOURCE_XMEMFILE(“/test.swf”, test_swf),
SSPEC_RESOURCE_XMEMFILE(“/playerProductInstall.swf”, PPI_swf),
SSPEC_RESOURCE_XMEMFILE(“/AC_OETags.js”, AC_OETags_js)
SSPEC_RESOURCETABLE_END

and Finally I changed the MIMETABLE to this.

SSPEC_MIMETABLE_START
SSPEC_MIME(“.html”, “text/html”),
SSPEC_MIME(“.swf”, “application/javascript”),
SSPEC_MIME(“.js”, “application/octet-stream”),
SSPEC_MIME(“.gif”, “image/gif”)
SSPEC_MIMETABLE_END

Now, as per the .pdf manual, I am supposed to change the mime type to the app that I am using, so the .swf is a “application/javascript” mime type. However when I compile I get and error of “String to Long” for the “application/javascript” & “application/octet-stream”.

So now what ?

SSPEC_MIME(".swf", "application/javascript"),

try to change

SSPEC_MIMETABLE_START
SSPEC_MIME(“.html”, “text/html”),
SSPEC_MIME(“.swf”, “application/javascript”),
SSPEC_MIME(“.js”, “application/octet-stream”),
SSPEC_MIME(“.gif”, “image/gif”)
SSPEC_MIMETABLE_END

into:

SSPEC_MIMETABLE_START
SSPEC_MIME(“.html”, “text/html”),
SSPEC_MIME(“.swf”, “application/x-shockwave-flash”), // **
SSPEC_MIME(“.js”, “text/javascript”),
SSPEC_MIME(“.gif”, “image/gif”)
SSPEC_MIMETABLE_END

**cross your fingers :slight_smile: I never used swf files in my web applications,
look here for a mime-type reference.

Edit:
>>I get and error of “String to Long” for the “application/javascript” &
>>“application/octet-stream”.

the lenght limit of the string in zserver.lib is too short (20 chars) for all the mime types,
you can fix (I think) the code with this define:
#define SSPEC_MAXNAME 30

but the amount of memory needed will increase by 10 ( 30-20 )bytes for each sspec_* entry in the table

Hello, I suggest you read about mime application first if you have questions related to mime.

Hi, i need help with this problem please.

I have a fat system into sd card in RCM4300, and i need to include .zhtml script files, but i just read that FAT 16 system doesn�t support long name files or extension (it must be 8.3) and .zhtml has 5. I don�t know how to do…, someone can help me with this?.

Thanks

you solved your problem?

to .js try

SSPEC_MIME(“.js”,“text/javascript”),

and then tell us