nicolaiarocci/eve — pull request #304 by bendemaree (2014-04-05 16:30:44+00:00)
Title: Add support for content type for uploaded files

Hello! I've been using the (somewhat) new GridFS file upload feature in Eve, and have come across a situation in my app that consumes my API where I need the content type specified when the file is returned from Eve.

Since Eve also does not return the filename, it is difficult to use any method of guessing the file type.

Luckily, MongoDB supports a content type field, along with a few others, that are part of its result object. These changes add support for a few of these fields, namely `content_type` and `name`.

This is an API-breaking change. To return this extra meta information with the file, the output must be modified significantly. For example, the following (modified) output...

```
{
'_items': [
{
'_updated':'Sat, 05 Apr 2014 15:52:53 GMT',
'avatar':'abc=='
}
]
}
```
...would now appear as...

```
{
'_items': [
{
'_updated':'Sat, 05 Apr 2014 15:52:53 GMT',
'avatar': {
'file': 'abc==',
'content_type': 'text/plain',
'name': 'test.txt'
}
}
]
}
```

Let me know your thoughts. Thanks!