an issue when my app try to load an external css stylesheet - it has a bad mime type "text/html" not "text/css"
Added by Jean-Paul RUKUNDO over 10 years ago
Hi; I 'm new with Wt ( sorry for my poor English !).
I begin a robot app which need to drive GPIO of an ARM Board(OLINUXINO for information).
I try to use WPushButton and WSlider to adjust the speed of robot.
I copied the resources directory in the root of my app.
For deploying my app I use \" ./robot ---docroot ".;./resources" ---http-address 192.168.1.13 ---http-port 9090\".
The problem was that firefox load the page of the app but does not load the css to dislay the Wslider. The Firefox's Inspector say that "The stylesheet http://192.168.1.13:9090/resources/moz-transitions.css was not loaded because its MIME type, "text/html", is not "text/css\". I see the slider ticks but not the cursor.
How can I change the mime of the file moz-transitions.css ?
Is it a problem with the Wt built in server ?
PS: I join a screenshot with my app and Inspector message.
Thanks for your help.
Replies (4)
RE: an issue when my app try to load an external css stylesheet - it has a bad mime type "text/html" not "text/css" - Added by Wim Dumon over 10 years ago
Hello,
Maybe the . in ./resources confuses Wt? You should list URLs after the ';', so I would expect ---docroot ".;/resources"
Wim.
RE: an issue when my app try to load an external css stylesheet - it has a bad mime type "text/html" not "text/css" - Added by Jean-Paul RUKUNDO over 10 years ago
Hello Wim,
thanks for your response.
I think the Url list was correct, because the server upload the CSS file but with a wrong mime type. I have joined a screenshot and i can see that
css file was uploaded but firefox( on the client side) does not load its because of mime "text/html" ( not "text/css").
I don't know how i could convice the server (Wthttp ?) to send file with the right mime type.
Jean-Paul
RE: an issue when my app try to load an external css stylesheet - it has a bad mime type "text/html" not "text/css" - Added by Jean-Paul RUKUNDO over 10 years ago
Hello Wim,
you're wright, the problem was the . in ./resource and i forgot to do "ln -s /usr/share/Wt/resources resources".
The issue was solved ;
thanks a lot
Jean-Paul.
[SOLVED] RE: an issue when my app try to load an external css stylesheet - it has a bad mime type "text/html" not "text/css" - Added by Jean-Paul RUKUNDO over 10 years ago
Jean-Paul RUKUNDO wrote:
Hello Wim,
you're wright, the problem was the . in ./resource and i forgot to do "ln -s /usr/share/Wt/resources resources".The issue was solved ;
thanks a lotJean-Paul.