Ticket #210 (closed story: fixed)

Opened 14 years ago

Last modified 14 years ago

MIME type control for uploaded file

Reported by: hans Owned by: tarmo
Priority: major Milestone: 0.2 Spring roll
Component: generic Version:
Keywords: Cc:
Time planned: Time remaining:
Time spent:

Description (last modified by hans) (diff)

MIME type of uploaded file is controlled to make sure if it is piece or material (see diagram in #141). The following MIME types are considered as pieces:

  • text/plain
  • image/gif
  • image/jpeg
  • image/png
  • audio/mpeg
  • audio/x-wav
  • application/ogg
  • video/mpeg
  • video/quicktime

If the MIME type indicates that the user has uploaded a piece, the following message is displayed:

The file has been successfully uploaded and checked by the system. This is <a text / an image / a sound clip / a video clip> and therefore we suggest to publish it under pieces. If you are sure that it is a material then you can choose the second option here.

<input type="submit" value="Piece" selected="selected" /> <input type="submit" value="Material" />

In case of material the message looks as follows:

The file has been successfully uploaded and checked by the system. We suggest to publish it under materials. If you are sure that it is a piece then you can choose the first option here.

<input type="submit" value="Piece" /> <input type="submit" value="Material" selected="selected" />

Change History

comment:1 Changed 14 years ago by hans

I was not able to find MIME types for WAV and OGG files from this list: http://www.iana.org/assignments/media-types/

WAV and OGG can be also pieces in many cases.

comment:2 Changed 14 years ago by hans

I am not sure, if most of video files are pieces or materials. It is possible, that we will later remove video/mpeg and video/quicktime from that list.

comment:3 Changed 14 years ago by tarmo

OGG is application/ogg and WAV is audio/x-wav.

See the file /etc/mime.types in your Linux or Mac OS X system.

Are all other mime types than those identified as pieces considered material? Are some mime types disallowed altogether?

comment:4 Changed 14 years ago by hans

  • Description modified (diff)

comment:5 Changed 14 years ago by hans

Short discussion with Tarmo. We should have 3 lists of MIME types:

  • pieces
  • materials
  • blacklist (MIME types that are not allowed)

If uploaded file does not fall into one of those three we should say to the user that the system was not able to determine the file type and suggest user to upload the file in a more widely known format. It is also possible to continue publishing the file in the current format.

comment:6 Changed 14 years ago by martin

Beginning of the Material MIME type list:

  1. application/x-shockwave-flash
  2. application/application/pdf
  3. ...

Beginning of the MIME type black list:

  1. application/vnd.ms-excel
  2. application/msword
  3. ...

Maybe it is enough when we define MIME type list for pieces and list for materials and all types that have left out are not allowed.

comment:7 Changed 14 years ago by tarmo

Nope, we need a specific black list. If we disallow anything we don't recognize, then we have a problem that when new content types are taken into use in the world, our system will not allow them, even if it should. We'd need to update the white lists all the time and somehow make sure that all installations get the updates. This is why it's better to have a list of known recommended types and then a list of known unwanted types, like application/x-executable, that we'll never allow. The system cannot know how it should handle unknown types, so it should ask the user.

comment:8 Changed 14 years ago by tarmo

  • Owner changed from anonymous to tarmo
  • Status changed from new to assigned

comment:9 Changed 14 years ago by tarmo

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.