2013-03-11 69 views
0

我有在IOS FileTransfer.upload圖像的問題,我用你給的例子: http://docs.phonegap.com/en/2.5.0/cordova_file_file.md.html#FileTransfer的PhoneGap 2.5.0在IOS文件傳輸上傳圖片,返回405碼3

當我打電話給FileTransfer.upload從ios我得到代碼3和HTTP狀態405.我嘗試從服務器端使用ashx(處理程序)文件。

所有這些工作很好從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); 
} 

兩天都沒有成功 請幫助我。

10X。

+1

同樣的問題和答案在這裏 - http://stackoverflow.com/questions/13458099/how-to-use-phonegap-filetransfer-parameters-with-asmx-web-service – 2013-03-11 14:40:40

+0

不,這不是我的問題... – user2157211 2013-03-12 21:57:30

回答

0

您需要查看服務器日誌以查看導致405「方法不允許」錯誤的原因。看看文件是如何被請求的。

+0

爲什麼在android和ios中不一致? – 2013-06-27 18:29:37