You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Alan Neveu (Commented) (JIRA)" <ji...@apache.org> on 2012/04/17 15:25:21 UTC

[jira] [Commented] (CB-517) Cannot Remove a FileEntry using PhoneGap 1.6.1

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

Alan Neveu commented on CB-517:
-------------------------------

Good news, I think I found the solution to this one for you.. I added a few lines to the "MonkeyPatch" File section of cordova-1.6.1.js and that seems to have solved it.  Here is my modified File: section of MonkeyPatch, I added the 4 lines starting at "remove"...

File:
	{
		"getFileMetadata":function(arg)
		{
			return  {fullPath:arg[0]};
		},
		"readAsText":function(arg)
		{ //[this.fileName, enc]
			return {fileName:arg[0],encoding:arg[1]};
		},
		"readAsDataURL":function(arg)
		{
			return {fileName:arg[0]};
		},
		"getDirectory":function(arg)
		{
			return {fullPath:arg[0],path:arg[1],options:arg[2]};
		},
        "remove":function(arg)
		{ 
			return {fullPath:arg[0]};
		},
		"removeRecursively":function(arg)
		{ 
			return {fullPath:arg[0]};
		},
		"getFile":function(arg)
		{
			return {fullPath:arg[0],path:arg[1],options:arg[2]};
		},
		"readEntries":function(arg)
		{
			return {fullPath:arg[0]};
		},
		"write":function(arg)
		{
			return {fileName:arg[0],data:arg[1],position:arg[2]};
		},
		"truncate":function(arg)
		{
			return {fileName:arg[0],size:arg[1]};
		}

	},

Great!
                
> Cannot Remove a FileEntry using PhoneGap 1.6.1
> ----------------------------------------------
>
>                 Key: CB-517
>                 URL: https://issues.apache.org/jira/browse/CB-517
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: WP7
>    Affects Versions: 1.6.1
>         Environment: VS.NET 2010 with WP7.1 emulator
>            Reporter: Alan Neveu
>            Assignee: Jesse MacFadyen
>            Priority: Blocker
>
> Using the latest 1.6.1 for WP7 from GitHub, when my app calls fileEntry.remove I see the following error in the Output window and the file is not removed:
> A first chance exception of type 'System.InvalidCastException' occurred in System.ServiceModel.Web.dll
> The error actually appears twice for each time the .remove method is called.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira