You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Joachim Piketz (JIRA)" <ji...@apache.org> on 2014/01/30 13:40:08 UTC
[jira] [Updated] (CB-5946) Automatic mime type
[ https://issues.apache.org/jira/browse/CB-5946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joachim Piketz updated CB-5946:
-------------------------------
Description:
Feature request: automatically detect mime type in filetransfer plugin.
The following works for me in Android:
{code}
String mime = "application/octet-stream";
try
{
mime = cordova.getActivity().getContentResolver().getType(sourceUri);
}
catch (Exception e)
{
Log.e(LOG_TAG, e.getMessage(), e);
}
final String mimeType = mime;
Log.d(LOG_TAG, "mimeType: " + mimeType);
{code}
was:
Feature request: automatically detect mime type.
The following works for me in Android:
{code}
String mime = "application/octet-stream";
try
{
mime = cordova.getActivity().getContentResolver().getType(sourceUri);
}
catch (Exception e)
{
Log.e(LOG_TAG, e.getMessage(), e);
}
final String mimeType = mime;
Log.d(LOG_TAG, "mimeType: " + mimeType);
{code}
> Automatic mime type
> -------------------
>
> Key: CB-5946
> URL: https://issues.apache.org/jira/browse/CB-5946
> Project: Apache Cordova
> Issue Type: Improvement
> Components: Android, Plugin File Transfer
> Affects Versions: 3.3.0
> Reporter: Joachim Piketz
>
> Feature request: automatically detect mime type in filetransfer plugin.
> The following works for me in Android:
> {code}
> String mime = "application/octet-stream";
> try
> {
> mime = cordova.getActivity().getContentResolver().getType(sourceUri);
> }
> catch (Exception e)
> {
> Log.e(LOG_TAG, e.getMessage(), e);
> }
> final String mimeType = mime;
> Log.d(LOG_TAG, "mimeType: " + mimeType);
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)