Access sd card in android for uploading a file to my php server using phonegap

前端 未结 1 528
醉梦人生
醉梦人生 2021-01-28 07:03

I want to go to select a file from sdcard and upload it to server. is it possible to access the sdcard in android via phonegap as how we are picking a image from gallery and upl

1条回答
  •  猫巷女王i
    2021-01-28 07:21

    U can easily do that its very easy
    
        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccessUpload, fail);
    
        function onFileSystemSuccessUpload(fileSystem) {
         // get directory entry through root and access all the folders
                 var directoryReader = fileSystem.root.createReader();
    
        // Get a list of all the entries in the directory
        directoryReader.readEntries(successReader,fail); 
    
              }
    
          function successReader(entries) {
            var i;
            for (i=0; i
                                                            
0 讨论(0)
提交回复
热议问题