You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Vladimir Kotikov (JIRA)" <ji...@apache.org> on 2014/09/26 14:34:34 UTC

[jira] [Commented] (CB-7266) Windows 8 - resolveLocalFileSystemURI fails when trying to resolve ms-appdata URLs

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

Vladimir Kotikov commented on CB-7266:
--------------------------------------

Jesse, Kelvin, this seems to be fixed in https://issues.apache.org/jira/browse/CB-7413 and can now marked as resolved...

> Windows 8 - resolveLocalFileSystemURI fails when trying to resolve ms-appdata URLs
> ----------------------------------------------------------------------------------
>
>                 Key: CB-7266
>                 URL: https://issues.apache.org/jira/browse/CB-7266
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File, Windows 8
>    Affects Versions: 3.5.0
>         Environment: Windows 8.1; Visual Studio 2013 Professional; Cordova 3.5.0 (running on a WinRT Surface)
>            Reporter: Kelvin Dart
>            Assignee: Jesse MacFadyen
>            Priority: Critical
>
> When I take a photo using, for example, the following code:
> {code:javascript}
> navigator.camera.getPicture(
> 	function (uri) {
> 		var image = document.getElementById('myImg');
> 		image.src = uri;
> 	},
> 	function () {
> 		// Do nothing for now
> 	});
> {code}
> The uri returned in the success function is of the following format: {{ms-appdata:///local/camera_cordova_temp_return.jpg}}.
> Which is good! However, I am attempting to resolve this image to a b64 string, using window.resolveLocalFileSystemURL - but this is failing.
> I have debugged the problem and have noticed the issue is related to the following part of the function:
> {code}
> if (path.substr(0, 8) == "file:///") {
> 	path = Windows.Storage.ApplicationData.current.localFolder.path + "\\" + String(path).substr(8);
> } else {
> 	// method should not let read files outside of the [APP HASH]/Local or [APP HASH]/temp folders
> 	if (path.indexOf(Windows.Storage.ApplicationData.current.temporaryFolder.path) != 0 &&
> 		path.indexOf(Windows.Storage.ApplicationData.current.localFolder.path) != 0) {
> 		fail && fail(FileError.ENCODING_ERR);
> 		return;
> 	}
> }
> {code}
> The code is only able to resolve either a URI of type {{C:\}} (an absolute path) or a {{file://}} protocol - nothing else (and so, never {{ms-appdata://}}).
> Can this be altered so ms-appdata can be resolved and I can convert my image to B64?
> Thanks
> *Edit:* the getPicture method does not have a parameter object passed since the default parameters are sufficient.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)