[ 
https://issues.apache.org/jira/browse/CB-5946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

jcesarmobile closed CB-5946.
----------------------------
    Resolution: Won't Do

The plugin has been deprecated and this won't be implemented.
Read the blog post about the alternatives
https://cordova.apache.org/blog/2017/10/18/from-filetransfer-to-xhr2.html

> Automatic mime type in Filetransfer plugin
> ------------------------------------------
>
>                 Key: CB-5946
>                 URL: https://issues.apache.org/jira/browse/CB-5946
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-plugin-file-transfer (DEPRECATED)
>    Affects Versions: 3.3.0
>            Reporter: Joachim Piketz
>            Priority: Major
>              Labels: Android
>
> Feature request: automatically detect mime type in filetransfer plugin.
> The following works for me in Android:
> {code}
>         String mime = null;
>         try 
>         {
>               mime = 
> this.cordova.getActivity().getContentResolver().getType(sourceUri);
>               if (mime == null)
>               {
>                   MimeTypeMap mimemap = MimeTypeMap.getSingleton();
>                   String uri = sourceUri.toString();
>                   int index = uri.lastIndexOf('.');
>                   if (index != -1)
>                           mime = 
> mimemap.getMimeTypeFromExtension(uri.substring(index+1).toLowerCase());
>               }
>         }
>         catch (Exception e)
>         {
>               Log.e(LOG_TAG, e.getMessage(), e);              
>         }
>         
>         if (mime == null)
>               mime = "application/octet-stream";
>         
>         final String mimeType = mime; 
>                       
>         Log.d(LOG_TAG, "mimeType: " + mimeType);
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to