iphonic
iphonic

Reputation: 12719

Dreamfactory - Different content type of uploaded file

We are facing a strange issue, we are using Dreamfactory to store Audio files that are recorded in iOS device of type m4a, which is working fine and getting uploaded without problem.

We are facing problem when trying to access the Audio file from server the content type returned from the file stored in dreamfactory is audio/x-m4a, which is unrecognizable for iOS SDK, when I uploaded the same file is different server and accessed the content type is audio/mp4 and the audio file plays fine without any problem.

We are not able to determine the problem. Can any one help?

Thanks.

Upvotes: 0

Views: 101

Answers (2)

miknik
miknik

Reputation: 5941

Edit line 74 of /etc/nginx/mime.types

By default it will be set to:

audio/x-m4a m4a;

Change it, save and run

$ nginx -s reload

Upvotes: 1

Jason Gilmore
Jason Gilmore

Reputation: 4068

Hi @iphonic DreamFactory isn't going to manipulate the file MIME type in any way. To my understanding, the mime type x- prefix is used in conjunction with non-standard MIME types as defined by the IETF, so it sound like the underlying web server isn't configured to identify this MIME type and is therefore prefixing it with the x-. Perhaps you could modify your web server configuration to associate the file extension with the desired MIME type? For instance you could use Apache's AddType directive to do so:

https://httpd.apache.org/docs/2.4/mod/mod_mime.html#addtype

Similarly, NGINX supports types:

http://nginx.org/en/docs/http/ngx_http_core_module.html#types

As a solution of last resort, you could probably modify the MIME type on the fly using DreamFactory's post-processing event handler:

http://wiki.dreamfactory.com/DreamFactory/Features/Scripting

Upvotes: 1

Related Questions