cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joachim Piketz (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-6349) Return mime type in FileTransfer download
Date Wed, 26 Mar 2014 09:13:15 GMT
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)

Mime
View raw message