Schrift
[thread]5646[/thread]

Diverse kleine Sachen

Leser: 1


<< >> 3 Einträge, 1 Seite
[E|B]
 2003-08-23 14:28
#75534 #75534
User since
2003-08-08
2561 Artikel
HausmeisterIn
[Homepage] [default_avatar]
Hi!
Kann mir einer bitte folgende Fragen beantworten:

1. Was ist der Unterschied zwischen folgenden Headern:

Code: (dl )
1
2
3
4
5
Content-Disposition: inline;
Content-Disposition: attachment;
.
.
.


Gibt es da evtl. noch mehr?

2. Kann mir jemand die Base64 Kodierung erklären?

Code: (dl )
1
2
3
4
5
6
7
8
9
10
while ($_[0] =~ /(.{1,45})/gs){
$encode .= substr(pack('u', $1), 1);
chop($encode);
}

$encode =~ tr|` -_|AA-Za-z0-9+/|;
$align = (3 - length($_[0]) % 3) % 3;
$encode =~ s/.{$align}$/'=' x $align/e if($align);

$encode =~ s/(.{1,76})/$1\n/g;


Das wars erstmal fürs erste. ;o)
Gruß, Erik!

s))91\&\/\^z->sub{}\(\@new\)=>69\&\/\^z->sub{}\(\@new\)=>124\&\/\^z->sub{}\(\@new\)=>);
$_.=qq~66\&\/\^z->sub{}\(\@new\)=>93~;for(@_=split(/\&\/\^z->sub{}\(\@new\)=>/)){print chr;}

It's not a bug, it's a feature! - [CGI-World.de]
jan10001
 2003-08-23 15:30
#75535 #75535
User since
2003-08-14
962 Artikel
BenutzerIn
[default_avatar]
Zu 2. lies dir mal das durch:
http://selfaktuell.teamone.de/artikel/javascript/utf8b64/base64.htm

Zu 1.
Grübel ist schon lange her. :)
Also
Code: (dl )
Content-Disposition
ist ein Zusatzfeld in MIME. In diesen Fall wird mit inline angegeben das es sich um ein Element in der der Email handelt, während attachment ein Element ist das an die Email angehangen wurde.
z.B. inline könnte ein Bild in einer HTML Email sein
und attachment eine beliebige Datei die aber nicht im Email angezeigt wird

Quote
Auszug aus RFC 1521
6.2 Optional Content-Description Header Field

The ability to associate some descriptive information with a given body is often desirable. For example, it may be useful to mark an "image" body as "a picture of the Space Shuttle Endeavor." Such text may be placed in the Content-Description header field.

description := "Content-Description" ":" *text

The description is presumed to be given in the US-ASCII character set, although the mechanism specified in [RFC-1522] may be used for non-US-ASCII Content-Description values.
\n\n

<!--EDIT|jan10001|1061638403-->
Dubu
 2003-08-23 15:33
#75536 #75536
User since
2003-08-04
2145 Artikel
ModeratorIn + EditorIn

user image
Zu 1.:
"inline" empfiehlt dem User Agent, den betreffenden Teil innerhalb der anderen Teile direkt darzustellen.
"attachment" empfiehlt dem User Agent, den betreffenden Teil als Anhang zu behandeln, d.h. nicht automatisch darzustellen, sondern nur anzuzeigen, dass er vorhanden ist und weitere Verarbeitung anzubieten.

[quote=RFC 2183,Zeile 177ff]
2.1  The Inline Disposition Type

  A bodypart should be marked `inline' if it is intended to be
  displayed automatically upon display of the message.  Inline
  bodyparts should be presented in the order in which they occur,
  subject to the normal semantics of multipart messages.

2.2  The Attachment Disposition Type

  Bodyparts can be designated `attachment' to indicate that they are
  separate from the main body of the mail message, and that their
  display should not be automatic, but contingent upon some further
  action of the user.  The MUA might instead present the user of a
  bitmap terminal with an iconic representation of the attachments, or,
  on character terminals, with a list of attachments from which the
  user could select for viewing or storage.
[/quote]
Siehe RFC 2183.

Zu 2.:
Base 64 ist eine Kodierung, die beliebige Binaerdaten auf druckbare Zeichen aus der Menge [A-Za-z0-9+/] abbildet, somit werden pro ausgegebenem Zeichen 6 Bit des Binaerwertes kodiert (zusaetzlich wird noch das Zeichen '=' fuer besondere Kodierungen benutzt). Base64 wird in RFC 2045 definiert.
<< >> 3 Einträge, 1 Seite



View all threads created 2003-08-23 14:28.