edx/edx-platform — pull request #5731 by ataki (2014-10-26 20:15:43+00:00)
Title: Ataki/upstream

This PR puts a limit on the size of files that course staff can upload to MongoDB.

**Background** When course staff upload files to the course in Studio via "Content -> Files & Uploads", these files land in the Mongo datastore. Having large files there makes our mongo database unwieldy, and causes performance problems. Our solution imposes a hard limit (10MBs) on the front-end as well as backend. The limit can be configured by changing the```MAX_ASSET_UPLOAD_FILE_SIZE_IN_MB```constant specified inside ```cms/envs/common.py``.

**Testing** To manually test the feature, boot up the devstack and navigate to "Content -> Files & Uploads". When you attempt to upload a file greater than 10MB, an error message will pop up warning the user that the limit has been exceeded, and giving instructions for how to proceed via an external url. Attempts to circumvent the javascript and directly upload a file larger than the limit will also fail, as the limit is also imposed on the backend.

Here is a screenshot of the expected behavior (error message):
![screen shot 2014-10-26 at 11 58 59 am](https://cloud.githubusercontent.com/assets/728509/4784072/2ecbb98a-5d42-11e4-9455-733a11d37378.png)