【问题标题】:phonegap 2.5.0 in IOS filetransfer upload image, return 405 and code 3phonegap 2.5.0 in IOS filetransfer上传图片,返回405和code 3
【发布时间】:2013-03-25 22:34:26
【问题描述】:

我在 IOS 中遇到 FileTransfer.upload 图像的问题,我使用您给出的示例: http://docs.phonegap.com/en/2.5.0/cordova_file_file.md.html#FileTransfer

当我从 ios 调用 FileTransfer.upload 时,我得到代码 3 和 HTTP 状态 405。我尝试从服务器端使用 ashx(handler) 文件。

所有这些在 android 上都可以正常工作,两者的代码完全相同。

我的代码:

function uploadPhoto(imageURI) {
    var options = new FileUploadOptions();
    options.fileKey = "file";
    options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);
    options.mimeType="image/jpeg";

    var fileImageTransfer = new FileTransfer();

    fileImageTransfer.upload(imageURI, domain + "/handlers/imageupload.ashx?greetingID=5", win, fail, options);
}

两天没有成功 请帮帮我。

10 倍。

【问题讨论】:

标签: ios cordova file-transfer


【解决方案1】:

您需要查看服务器日志以了解导致 405“方法不允许”错误的原因。查看文件是如何被请求的。

【讨论】:

  • 为什么android和ios不一致?
猜你喜欢
  • 2023-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多