content,
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:kid="http://purl.org/kid/ns#"
kid:strip=""
>
<?python
mime_types = """
# This is a comment. I love comments.
# This file controls what Internet media types are sent to the client for
# given file extension(s). Sending the correct media type to the client
# is important so they know how to handle the content of the file.
# For more information about Internet media types,
# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type
# registry is at <http://www.iana.org/assignments/media-types/>.
# MIME type Extension
application/msword Microsoft Word
application/octet-stream Binary
application/pdf PDF
application/postscript Postscript
application/rtf RTF
application/vnd.ms-excel Microsoft Excel
application/vnd.ms-powerpoint Microsoft Powerpoint
application/x-bzip2
application/x-gtar
application/x-gzip
application/x-java-archive Java Archive
application/x-java-jnlp-file Java JNLP File
application/x-javascript Javascript
application/x-shockwave-flash Shockwave Flash
application/x-tar
application/x-tex Tex
application/x-texinfo Texinfo
application/xhtml+xml XHTML
application/xml
application/zip Zip
image/bmp bmp
image/gif gif
image/jpeg jpeg
image/png png
image/tiff tiff
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/rfc822
text/calendar
text/css css
text/directory
text/enriched
text/html html
text/parityfec
text/plain txt
text/prs.lines.tag
text/rfc822-headers
text/richtext rtx
text/rtf rtf
text/sgml sgml
text/tab-separated-values tsv
text/uri-list
text/xml xml
text/xml-external-parsed-entity
video/mp4v-es
video/mpeg mpeg
video/parityfec
video/pointer
video/quicktime qt
video/x-flv flv
video/x-ms-asf asf
video/x-ms-wm wm
video/x-ms-wmv wmv
video/x-ms-wmx wmx
video/x-ms-wvx wvx
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
"""
types = []
for line in mime_types.split("\n"):
line = line.strip()
if line.startswith("#"):
continue
line = line.replace("\t", " ")
parts = line.split(" ")
if len(parts)>0:
type = parts[0]
if type:
types.append((type, type))
label = " ".join(parts[1:])
label = label.strip()
if label:
types.append((label, type))
types.sort()
?>
<form action="process/" enctype="multipart/form-data" method="POST">
<table>
<tr>
<th>File</th>
<td><input type="file" name="file" value="" size="60"/></td>
</tr>
<tr>
<th>Content Type</th>
<td>
<select type="text" name="content_type">
<option kid:for="label, type in types" value="${type}">${label}</option>
</select>
</td>
</tr>
<tr>
<th>Document Name</th>
<td><input type="text" name="label" size="60" value=""/></td>
</tr>
<tr>
<th>Comment</th>
<td><textarea name="comment" rows="5" cols="60"></textarea></td>
</tr>
<tr>
<th>Keywords (comma separated)</th>
<td><input type="text" name="keywords" size="60" value=""/></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value="upload"/></td>
</tr>
</table>
</form>
</div>
Comments regarding Upload Page Part Handler
Login to submit a comment.