You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Richard Kimber (Updated) (JIRA)" <ji...@apache.org> on 2012/04/19 23:26:40 UTC
[jira] [Updated] (CB-543) FileTransfer.upload WebKit discarded an
uncaught exception
[ https://issues.apache.org/jira/browse/CB-543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard Kimber updated CB-543:
------------------------------
Description:
Unable to upload file to server using FileTransfer.upload.
The following code:
var onSuccess, onError;
options.destinationType = Camera.DestinationType.FILE_URI;
onSuccess = function(imageURI) {
Ext.get("uploaded_image_" + name).setStyle("background-image","url(" + imageURI + ")");
app.views[name + "Form"].imageURI = imageURI;
};
onError = function(message) {
console.log(message);
Ext.Msg.alert("Camera", "There was a problem with the camera.");
};
navigator.camera.getPicture(onSuccess, onError, options);
----
var options = new FileUploadOptions();
options.fileKey = "repair[image]";
options.params = fix_form_names(form.getValues());
var ft = new FileTransfer();
ft.upload(form.imageURI, form.url, win, fail, options, true);
Returns the following error:
*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[JKArray objectAtIndex:]: index (4) beyond bounds (4)
This code was working on PhoneGap 1.4.1.
Further reports at https://groups.google.com/forum/?fromgroups#!topic/phonegap/w8SOE5IEr9o
was:
Unable to upload file to server using FileTransfer.upload.
The following code:
var onSuccess, onError;
options.destinationType = Camera.DestinationType.FILE_URI;
onSuccess = function(imageURI) {
Ext.get("uploaded_image_" + name).setStyle("background-image","url(" + imageURI + ")");
app.views[name + "Form"].imageURI = imageURI;
};
onError = function(message) {
console.log(message);
Ext.Msg.alert("Camera", "There was a problem with the camera.");
};
navigator.camera.getPicture(onSuccess, onError, options);
----
var options = new FileUploadOptions();
options.fileKey = "repair[image]";
options.params = fix_form_names(form.getValues());
var ft = new FileTransfer();
ft.upload(form.imageURI, form.url, win, fail, options, true);
Returns the following error:
*** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[JKArray objectAtIndex:]: index (4) beyond bounds (4)
> FileTransfer.upload WebKit discarded an uncaught exception
> ----------------------------------------------------------
>
> Key: CB-543
> URL: https://issues.apache.org/jira/browse/CB-543
> Project: Apache Callback
> Issue Type: Bug
> Components: iOS
> Affects Versions: 1.6.1
> Environment: OS X Lion, Xcode 4.3.2, iPhone iOS 5.1
> Reporter: Richard Kimber
> Assignee: Shazron Abdullah
>
> Unable to upload file to server using FileTransfer.upload.
> The following code:
> var onSuccess, onError;
> options.destinationType = Camera.DestinationType.FILE_URI;
> onSuccess = function(imageURI) {
> Ext.get("uploaded_image_" + name).setStyle("background-image","url(" + imageURI + ")");
> app.views[name + "Form"].imageURI = imageURI;
> };
>
> onError = function(message) {
> console.log(message);
> Ext.Msg.alert("Camera", "There was a problem with the camera.");
> };
> navigator.camera.getPicture(onSuccess, onError, options);
> ----
> var options = new FileUploadOptions();
> options.fileKey = "repair[image]";
> options.params = fix_form_names(form.getValues());
> var ft = new FileTransfer();
> ft.upload(form.imageURI, form.url, win, fail, options, true);
> Returns the following error:
> *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[JKArray objectAtIndex:]: index (4) beyond bounds (4)
> This code was working on PhoneGap 1.4.1.
> Further reports at https://groups.google.com/forum/?fromgroups#!topic/phonegap/w8SOE5IEr9o
--
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