Mpeg4 Audio files (.m4a) cannot be "viewed" with the fileservice. This is because the view function in api.py uses mime_type = mime.guess_type(url), and the mime_types dict (as of python 2.7.11) doesn't include a mapping for m4a. A simple solution (tested) could be:
mime_type = mime.guess_type(url)
# If mime_type is unknown, add a known file type.
if not mime_type[0]:
file_ext = os.path.splitext(url)[1]
if file_ext == '.mp4':
mime_type = ('audio/mp4',None)
Mpeg4 Audio files (.m4a) cannot be "viewed" with the fileservice. This is because the view function in api.py uses
mime_type = mime.guess_type(url)
, and the mime_types dict (as of python 2.7.11) doesn't include a mapping for m4a. A simple solution (tested) could be: