Joachim Piketz created CB-6349:
----------------------------------

             Summary: Return mime type in FileTransfer download
                 Key: CB-6349
                 URL: https://issues.apache.org/jira/browse/CB-6349
             Project: Apache Cordova
          Issue Type: Improvement
          Components: Plugin File Transfer
    Affects Versions: 3.3.0
         Environment: Android
            Reporter: Joachim Piketz


Return the mime type if the file is transferred using Url Connection. 

Changes in FileTransfer.java

...
JSONObject fileEntry = FileUtils.getEntry(file);
// added start
if (connection != null)
    fileEntry.put("type", connection.getContentType());          
// added end
result = new PluginResult(PluginResult.Status.OK, fileEntry);
...

Changes in JS Function FileTransfer.prototype.download
...
               entry.type = result.type;  // added
               entry.isDirectory = result.isDirectory;
...



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to