English 中文(简体)
Cordova案卷错误在Xcode中——“WebKit 弃之无有例外”
原标题:Cordova fileupload errors in xcode - "WebKit discarded an uncaught exception"
  • 时间:2012-04-13 13:41:27
  •  标签:
  • cordova

在科多瓦1.6.0号工作时,我花了时间。 我没有用较早的版本对其进行审判,因此我不知道这是否是一个新问题。

var options = new FileUploadOptions();
options.fileKey = "file";

var ft = new FileTransfer();
ft.upload( 
    imageURLToLocalFile, 
    urlToMyServiceEndpoint, 
    successhandler,
    errorhandler,
    options
);

在X条码中,见I。

*** WebKit discarded an uncaught exception in the
webView:decidePolicyForNavigationAction:request:frame:decisionListener: 
delegate: <NSRangeException> ***
 -[JKArray objectAtIndex:]: index (1) beyond bounds (1)

Seems to me that when the Cordova exec function is calls the home filehandler function this event, but I has no concept how to interpret the misnote.

我对造成错误的呼声,即Cordova案卷宗中的文件Transfer.prototype.upload功能,没有什么怀疑。 1.6版是:

exec(
    successCallback, 
    errorCallback, 
     FileTransfer , 
     upload , 
    [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode]
);

旧的1.5版是:

Cordova.exec(
    successCallback,
    errorCallback,
     org.apache.cordova.filetransfer , 
     upload , 
    [options]
);
最佳回答

这是Cordova 1.6.x的ug,将在Cordova 1.7.0(https://issues.apache.org/jira/browse/CB-543)上解决。

工作是人工确定所有备选办法(档案Name、档案Key等),因为框架不正确地将这些选择视为强制性的。

So:

var options = new FileUploadOptions();
options.fileKey = "file";

Becomes:

var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = "image.jpg";
options.mimeType = "image/jpeg";
options.chunkedMode = true;
options.params = {}; // This line is untested as I have actual params

法学硕士

问题回答

如同上载方法一样,眼镜也发生了变化。 我有类似的问题,通过在选择之后添加真实性来解决:

var ft = new FileTransfer();
ft.upload(

  imageURLToLocalFile, 
  urlToMyServiceEndpoint, 
  successhandler,
  errorhandler,
  options,
  **true**
);




相关问题
Javascript data store solution using PhoneGap

Does anyone have any experience of storing data in JavaScript across all mobile platforms using PhoneGap? My ideal solution would be to use something like SQLite, but unfortunately SQLite isn t ...

get image from iphone, using phonegap camera api

I m new to Xcode and iPhone apps. I want to select an image from iPhone (camera or library) and send to php via ajax. http://wiki.phonegap.com/iPhone:-Camera-API I m using the phonegap framework, ...

Getting Search Keyboard on iPhone using PhoneGap

I have created a search field on a mobile app i am creating via PhoneGap. I ve tried using with no luck. I also know that i could get around the visual aspect of the input field via CSS & ...

How can I detect a shake gesture in PhoneGap 0.8?

I m using PhoneGap 0.8 and I d like to detect a basic shake gesture. I ve found two relevant snippets: http://groups.google.com/group/phonegap/browse_thread/thread/25178468b8eb9e9f http://phonegap....

How do I fix PhoneGap build errors?

I am trying to build a PhoneGap-based iPhone application, but I keep getting the following two errors: ./build-phonegap.sh: line 6: ./configure: No such file or directory cp: lib/iphone/phonegap-min....

热门标签