You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/12/22 17:39:36 UTC

[GitHub] [cordova-plugin-file] blgsyrmhnds edited a comment on issue #369: LocalFileSystem is not defined

blgsyrmhnds edited a comment on issue #369: LocalFileSystem is not defined
URL: https://github.com/apache/cordova-plugin-file/issues/369#issuecomment-568286022
 
 
   And here is my all index.html
   
   
   ```
   `<!DOCTYPE html>
   <html>
     <head>
       <title>FileReader Example</title>
   
       <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
       <script type="text/javascript" charset="utf-8">
   
       // Wait for device API libraries to load
       //
       document.addEventListener("deviceready", onDeviceReady, false);
   
       // device APIs are available
       //
       function onDeviceReady() {
   	try {
   
   	alert(window.PERSISTENT);
           window.requestFileSystem(window.PERSISTENT, 0, gotFS, fail);
   		
   		
   		
   		document.addEventListener("deviceready", function() { 
     window.requestFileSystem(window.PERSISTENT, 0, gotFS, fail);
   }, false);
   		
   		
   		}
   catch(err) {
     alert(err.message);
   }
       }
   
       function gotFS(fileSystem) {
   	alert('gotFS start');
   	<!-- Bu bilgisayar\VIBE K5 Note\Dahili depolama birimi\Download -->
           fileSystem.root.getFile("IISS_Paper_v2.0_KO.pdf", null, gotFileEntry, fail);
       }
   
       function gotFileEntry(fileEntry) {
           fileEntry.file(gotFile, fail);
       }
   
       function gotFile(file){
   	alert('gotFile');
           readDataUrl(file);
           readAsText(file);
       }
   
       function readDataUrl(file) {
   	alert('readDataUrl');
           var reader = new FileReader();
           reader.onloadend = function(evt) {
               console.log("Read as data URL");
               console.log(evt.target.result);
           };
           reader.readAsDataURL(file);
       }
   
       function readAsText(file) {
           var reader = new FileReader();
           reader.onloadend = function(evt) {
               console.log("Read as text");
               console.log(evt.target.result);
           };
           reader.readAsText(file);
       }
   
       function fail(error) {
   	alert(error.code);
           console.log(error.code);
       }
   
       </script>
     </head>
     <body>
       <h1>Example 3</h1>
       <p>Read File 3</p>
     </body>
   </html>`
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org