Merge pull request #838 from TitanNano/master

Closes #837
This commit is contained in:
Igor Zhukov 2015-06-30 18:08:25 +03:00
commit cb10fc7a88

View File

@ -1584,12 +1584,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
} else if (['image/jpeg', 'image/png', 'image/bmp'].indexOf(file.type) >= 0) {
attachType = 'photo';
apiFileName = 'photo.' + file.type.split('/')[1];
} else if (file.type.substr(0, 6) == 'audio/' || ['video/ogg'].indexOf(file.type) >= 0) {
attachType = 'audio';
apiFileName = 'audio.' + (file.type.split('/')[1] == 'ogg' ? 'ogg' : 'mp3');
} else if (file.type.substr(0, 6) == 'video/') {
attachType = 'video';
apiFileName = 'video.mp4';
} else if (file.type.substr(0, 6) == 'audio/') {
attachType = 'audio';
apiFileName = 'audio.' + (file.type.split('/')[1] == 'ogg' ? 'ogg' : 'mp3');
} else {
attachType = 'document';
apiFileName = 'document.' + file.type.split('/')[1];