0

The styles.css file is not loading on my web page, and I am hosting on Amazon S3. It appears that my styles.css file is being recognized as text/x-asm instead of text/css as stated in my index.html file:

<link title="styles" href="styles.css" type="text/css" rel="stylesheet" />

How can I correct the MIME type if I don't have access to the server? Is there a work around? Let me know if something is not clear. Here is the output using FireBug:

enter image description here

modulitos
  • 335
  • 1
  • 3
  • 16

1 Answers1

1

If you really get text/x-asm as your mime type, S3 has apparently tried to detect the correct type of your file using something called the file magic database. This database isn't perfect. Check your CSS file for any occurrence of one of the following...

.asciiz
.byte
.even
.globl
.text
.file
.type

...then reword or remove them. The file should no longer be detected as assembly (text/x-asm).


That said, I haven't found any evidence that S3 is actually doing MIME detection, and I wouldn't really expect them to - it's a relatively expensive operation. It may have been the program you're using to upload your CSS file onto S3, or it may be something else entirely. At any rate, you're probably better off setting the content type manually. Here's an article that shows how to do that, both through the web interface and through Panic Transmit.

Wander Nauta
  • 127
  • 6