Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9CCF17E57 for ; Fri, 10 Jul 2015 13:55:05 +0000 (UTC) Received: (qmail 27976 invoked by uid 500); 10 Jul 2015 13:55:05 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 27959 invoked by uid 500); 10 Jul 2015 13:55:05 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 27937 invoked by uid 99); 10 Jul 2015 13:55:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jul 2015 13:55:05 +0000 Date: Fri, 10 Jul 2015 13:55:05 +0000 (UTC) From: "Adam M. Smith (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-9020) cordova.file undefined on WP8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-9020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14622326#comment-14622326 ] Adam M. Smith commented on CB-9020: ----------------------------------- There is a workaround for this on stack overflow. http://stackoverflow.com/questions/26910891/cordova-file-is-undefined-for-windows-wp8 > cordova.file undefined on WP8 > ----------------------------- > > Key: CB-9020 > URL: https://issues.apache.org/jira/browse/CB-9020 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File > Affects Versions: 2.0.0 > Environment: Windows Phone 8 emulator > Reporter: Rex Park > Priority: Critical > > I have some code that tries to list all of the files in www/json. It works correctly on iOS and Android but fails on Windows Phone 8.1. > The code is pretty straight forward: > window.resolveLocalFileSystemURL(cordova.file.applicationDirectory+'/www/json', > function(dirEntry){ > var directoryReader = dirEntry.createReader(); > directoryReader.readEntries( > function(entries){ > ups_json_file_count = entries.length; > var i; > for (i=0; i < ups_json_file_count; i++) { > $.getJSON("json/"+entries[i].name, parse_json_files); > } > }, > function(){ > console.log("Coudl Not Locate JSON Files. 2"); > } > ); > }, > function(error){ > console.log("Could Not Locate JSON Directory. 1"); > } > ); > After doing some digging I found that cordova.file is coming up as undefined. The above code is being called inside of the onDeviceReady function. > cordova-plugin-file 2.0.0 "File" > cordova-plugin-file-transfer 1.0.0 "File Transfer" -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org