[Contents]   [Back]   [Prev]   [Up]   [Next]   [Forward]  


Multipart structure

If CT: is multipart, its content-body has multiple objects. They are separated with a string specified in the "boundary" parameter. Let's look at an example.

Message-Id: <13060.789566615@iijlab.net>
From: Kazuhiko Yamamoto =?ISO-2022-JP?B?GyRCOzNLXE9CSScbKEI=?=
        <kazu@iijlab.net>
Subject: =?ISO-2022-JP?B?GyRCPC8kTjMoGyhC?=
To: m-sakura@ccs.mt.nec.co.jp
Mime-Version: 1.0
Content-Type: Multipart/Mixed; boundary=simple
Content-Transfer-Encoding: 7bit

--simple
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Here is a picture of deer.

--Kazu
    
--simple
Content-Type: Image/Gif
Content-Transfer-Encoding: base64
Content-Description: "Deer on the Nara park"
    
R0lGODdhFwG8ANUAABETDCoYDC8lFi4dJxcnKTMwLkUUC04uG2opEkgeJ04yMWg4Ly1FLVJG
NWdSMywyTks1Tmc3RjdRVjNcalRMUG9UU1xbY051eG9pcIcxEp5bM8d1NI1VSJhrVrRwUpR0
cKZ1dcN9WXuHOWmHc7WJN6yLbcyEWNCZdDZjjml0i5t7im+TmGeRonWly5aLlrCLlK+arJmn
pbettMabktWumM+zsrnCrtTLua21ycq6x6/J3NbQ1+bk29na5dzp8+7w8ywAAAAAFwG8AAAG
/8CLcPhYtVgNyirWasZYEgDhIWGxRiXWcTIATHS/Hs6K2+1wt59azYtdJnBhKrVaWYcp7==
    
--simple--

In this case, a string "simple" is used. A string specified in the "boundary" parameter is preceded with "--". The last one is also followed by "--".

Each part consists of a content-header and a content-body. They are separated with a null line as header and body. Changing a point of view, header and body is special content-header and special content-body respectively.

When you send objects other than text, you should use multipart. Of course, it is not illegal to contain, for example, Audio/Basic in body but the receivers would be really confused. You are kind if you enclose describing text in the first part and embed Audio/Basic in the second part.

Multipart can take recursive. So, you can enjoy multipart of multipart.

By the way, preceding CRLF is included in a boundary. For example up above, the boundary is "CRLF--simpleCRLF".


[Contents]   [Back]   [Prev]   [Up]   [Next]   [Forward]