NodeJ + ExpressJS + EJS - Image is not shown

750 views
Skip to first unread message

akaRufus

unread,
Apr 21, 2011, 1:04:19 PM4/21/11
to Embedded JavaScript
Hi,

I have a nodeJs, ExpressJS and EJS Stack working.


EJS ist called like this:

app.register('.html', require('ejs'));
app.set('view engine', 'html');



If I render an html file everything works fine.
If I try to render an html file with an image tag, the image is there
but is will not be shown.

I get they Error : "Resource interpreted as Image but transferred with
MIME type text/html"
--> the problem seems to be that the image also gets the Content-Type
text/html.


How can i get this to work?
I allready tried to have something like this:

"
app.post('/public/img', function(req, res, next){

console.log("try to load an image");

if (req.is('image/png')) {
// do something
} else {
next();
}

});
"

This isn't working at all.
Any Suggestions???

thx
\akaRufus




Justin Meyer

unread,
Apr 21, 2011, 2:13:23 PM4/21/11
to embeddedj...@googlegroups.com
This seems like a question for a node group?  I haven't used node.






--
You received this message because you are subscribed to the Google Groups "Embedded JavaScript" group.
To post to this group, send email to embeddedj...@googlegroups.com.
To unsubscribe from this group, send email to embeddedjavascr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/embeddedjavascript?hl=en.


Dennis Gneuss

unread,
Apr 21, 2011, 2:24:47 PM4/21/11
to embeddedj...@googlegroups.com
thx

2011/4/21 Justin Meyer <justin...@gmail.com>
Reply all
Reply to author
Forward
0 new messages