You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jason Ginchereau (JIRA)" <ji...@apache.org> on 2015/11/12 21:30:11 UTC
[jira] [Resolved] (CB-9986) window.file on windows platform
undefined
[ https://issues.apache.org/jira/browse/CB-9986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason Ginchereau resolved CB-9986.
----------------------------------
Resolution: Duplicate
Assignee: Jason Ginchereau (was: Jesse MacFadyen)
Duplicate of CB-9887, already fixed but not yet released. There will be an updated plugins release available soon.
> window.file on windows platform undefined
> -----------------------------------------
>
> Key: CB-9986
> URL: https://issues.apache.org/jira/browse/CB-9986
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin File, Windows 8
> Affects Versions: 3.5.0
> Environment: Visual Studio Community 2015, Visual Studio Community 2015 Update 1 (RC)
> Reporter: Pavel
> Assignee: Jason Ginchereau
> Priority: Blocker
> Labels: path, windows
>
> I've tried to use the plugin on Windows 8.1 and Windows 10 (UWP) and I get the same problems every time.
> When the plugins are loaded, cordova.file/window.file is undefined , however I can overcome this issue with cordova.require function - which gives me the file object.
> But even by doing so, I don't get the file paths which declared in the documentation such as: cordova.file.dataDirectoryand others.
> That's how I'm overcoming this issue right now:
> if (!window.file) {
> window.file = cordova.require("cordova-plugin-file.FileProxy");
> window.file.requestAllPaths(function (paths) {
> for (var path in paths) {
> window.file[path] = paths[path];
> }
> ready();
> });
> }
> I got this code which runs fine on Android and IOS using angular:
> $cordovaFile.createDir(window.file.dataDirectory, directoryName, false).then(function (data) {
> return true;
> },
> function (error) {
> console.log("createParentDirectoryfaild");
> return false;
> });
> this code fails on Windows platform - cause window.file is undefined
--
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