Images in RSS feed

For completeness: In RSS 2.0, you CAN have a single enclosure inside an item, which per the spec. can be for a single image. However I understand that support among feed aggregators varies. More typically this is used for things like podcasts. The RSS 2.0 standard states:

<enclosure> is an optional sub-element of <item>. 

It has three required attributes. url says where the enclosure is located, length says how big it is in bytes, and type says what its type is, a standard MIME type. The url must be an http url.

Note that you must include the size of the item, along with the URL and mime type.

However, as others indicated, including the picture(s) in CDATA is much more common.


On Colonol Sponsz' hint, I researched:

There's no image tag for items, only for the channel. So you have to do it via the CDATA tag.

Tags:

Rss