WSO2 Enterprise Store 1.0.0: MIME types

191 Views Asked by At

Extending WSO2 ES with new assets implies adding new resource types. For example, distribution of Android apps require the download of apk files.

I've added new associations to the mime.types file (on repository/conf/etc), but the server always responds with an empty Content-Type header (even after reboot).

What is the correct method to add new MIME types?

1

There are 1 best solutions below

6
On

Could you provide a bit more information on your use case?

EDIT: Changed the answer using the information provided in the comments

When the file is uploaded we store the content type of the resource. The problem seems to be related to this logic.

switch(file){
              case 'jpg':
                  contentType='image/jpg';
                  break;
              case 'png':
                  contentType='image/png';
                  break;
          }

Please change this to:

switch(file){
              case 'jpg':
                  contentType='image/jpg';
                  break;
              case 'png':
                  contentType='image/png';
                  break;
              case  'apk':
                  contentType='application/vnd.android.package-archive'
                  break;
              default:
                  contentType='';
                  break;
          }

Please let me know if this helps :)

Thanks , Sameera