You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "brian johnston (JIRA)" <ji...@apache.org> on 2014/05/03 05:42:15 UTC

[jira] [Comment Edited] (CB-6566) Windows 8 cannot read files

    [ https://issues.apache.org/jira/browse/CB-6566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13988560#comment-13988560 ] 

brian johnston edited comment on CB-6566 at 5/3/14 3:42 AM:
------------------------------------------------------------

I got it to read files.  I installed VS 2012 Express and installed the latest Cordova 3.4 package.  Next, I transferred all my source code into Visual Studio project based on the WP8 project template.  Still, after building the project in VS2012 and running it on my Nokia phone, the same error occurred.  So I set several breakpoints in file.cs.  I noticed the readDataUrl method was implemented, but the others are not yet, so I tested it.  I discovered the FileEntry method breakpoints were getting hit, but the readAsDataURL method was never called.  So I moved up into the FileReader.js and added some console.logs.  Suddenly, the next time I ran it the debug breakpoint in the readAsDataURL method of file.cs was hit, weird. So,something was going on with javascript, but I don't know what.  It has worked fine ever since. 

One thing I don't understand is how the browser knows to call the Cordova FileReader methods instead of the HTML5 FileReader methods?  


was (Author: briankj):
I got it to read files.  I installed VS 2012 Express and installed the latest Cordova 3.4 package.  Next, I transferred all my source code into Visual Studio project based on the WP8 project template.  Still, after building the project in VS2012 and running it on my Nokia phone, the same error occurred.  So I set several breakpoints in file.cs.  I noticed the readDataUrl method was implemented, but the others are not yet, so I tested it.  I discovered the FileEntry method breakpoints were getting hit, but the readDataUrl method was never called.  So I moved up into the file.js and added some console.logs.  Suddenly, the next time I ran it the debug breakpoint in the readDataUrl method of file.cs was hit, weird. So,something was going on with javascript, but I don't know what.  It has worked fine ever since. 

One thing I don't understand is how the browser knows to call the Cordova FileReader methods instead of the HTML5 FileReader methods?  

> Windows 8 cannot read files
> ---------------------------
>
>                 Key: CB-6566
>                 URL: https://issues.apache.org/jira/browse/CB-6566
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: WP8
>            Reporter: brian johnston
>            Assignee: Jesse MacFadyen
>
> The getFile fileEntry object comes back OK, except the values of fullPath, toNativeUrl and toURL are identical.  I already reported that.  However, the fileEntry.isFile says "true" so I assumed something was there.  However when I pass that fileEntry into a FileReader object and try to use reader to read the file I get the following results:
> reader.readAsArrayBuffer and reader.readAsDataURL both throw a TYPE_MISMATCH_ERR.  I saw in the docs that readAsArrayBuffer is not supported on WP8, but I figured I'd try it anyway.
> I got an error message on reader.readAsBinaryString saying that method is missing.  I'm not surprised about that since the HTML spec says it is deprecated anyway.
> I also got a fileEntry back from window.resolveLocalFileSystemURI (had to put '///' in front of the folder and file name to get it to work) and tried to use that.  It gave the same results.



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