Add an Enclosure

Add an Enclosure

If you want to add audio, video, or even still JPEG images to your feed, you'll need to create an enclosure for them in which you'll specify their URL, size, and MIME type.

To find the size of an enclosure:

Select the file that you want to add to your RSS feed.

In Windows, choose Properties, and on the Mac, select Get Info.

Jot down the number of bytes in the desired enclosure (Figure).

Figure. When you choose the item on the Desktop and then either choose Properties (on Windows) or Get Info (on a Mac, shown), you'll see the number of bytes in the enclosure (in this case, 36,699,714).

To add an enclosure:

Within the article's item (that you created on page 382), type <enclosure.

Next, type url="http://www.", to indicate the location of the multimedia file on your server.

Type a space followed by length="n", where n is the number of bytes in your multimedia enclosure. You should use only digitsno commas or periods (e.g., 36699714).

Add type="type/subtype", where type and subtype make up the official MIME code for your enclosure (see tip).

Type /> to complete the enclosure.

Figure. The enclosure element goes inside the item element.


  • Make sure you use a full URL, complete with the HTTP protocol. Other protocols are not permitted.

    10. Some aggregators, like Feed-Demon (shown), let you download enclosures by clicking on a special icon or choosing a menu item.

  • Be sure to use the bytes, not the KB, MB, or GB when noting the size of the enclosure. Use only digitsand no place separators like commas or periodsfor specifying the size (e.g., 36699714).

  • You can find a list of MIME types here:

  • You can enclose any kind of file, it doesn't have to be audio or video. That doesn't mean that every aggregator will be able to handle it though. Some aggregators offer links to multimedia files that they cannot handle, while others ignore them completely.

    11. Other browsers, like this "Lite" version of NetNewsWire, may not support the enclosure at all, and not even reveal its existence to your readers.

  • iTunes can not only see multimedia enclosures, but can download and play them automatically as well.

  • Although this is technically all you need to create a podcast for iTunes, there are additional RSS tags developed by Apple that will help describe your podcast to prospective viewers and listeners, as described on the following pages.

 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows