2015-04-01 31 views

回答

0

首先添加科爾多瓦File插件到您的project.Then使用下面的代碼:

var reader = new FileReader(); 
    var fileSource = <file path>; 

    reader.onloadend = function(evt) { 

     if(evt.target.result != null) { 
      // If you receive not null value the file exists 
     } else { 
      // Otherwise the file doesn't exists 
     }   
    }; 

    // We are going to check if the file exists 
    reader.readAsDataURL(fileSource); 
的【如何與PhoneGap的電話簿檢查文件是否存在]
相關問題