2013-08-13 3 views
1

: http://docs.phonegap.com/en/3.0.0/cordova_file_file.md.html#FileTransfer 나는 다음과 같은 기능이 있습니다 FileTransfer 이후폰갭 FileTransfer 정의되지 않은 아이폰 OS 여기의 지침에 따라 후

function testUpload(imageURI) { 

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

    var params = {}; 
    params.value1 = "test"; 
    params.value2 = "param"; 


    options.params = params; 
    alert("This will show"); 
    alert(typeof(FileTransfer)); // "undefined" 
    var ft = new FileTransfer(); 
    alert("This will not show..."); 
    ft.upload(imageURI, encodeURI("my.server/.php"), win, fail, options); 

} 

() 진행하지 마십시오 업로드 진행 상황을 정의되지 않은됩니다. FileUploadOptions()를 호출하는 동안 오류가 발생하지 않아야합니까? 라이브러리 등을 위해 Google에로드하려고했으나 아무것도 찾을 수 없었습니다.

플러그인을 구현할 때 뭔가 잘못하고있는 것 같아요.

$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git 

을 그리고 코스 내 config.xml 파일에 추가 : 내가 사용하여로드 한

<feature name="File"> 
    <param name="ios-package" value="CDVFile" /> 
</feature> 
<feature name="FileTransfer"> 
    <param name="ios-package" value="CDVFileTransfer" /> 
</feature> 

감사합니다,

답변

5

나는 마지막으로 그냥 알아 냈어. 또한 이미 설치 한 File 플러그인 외에 FileTransfer 플러그인을 설치해야합니다.

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git 
관련 문제