Advertisement
Guest User

Untitled

a guest
Aug 4th, 2023
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   function saveFileJS(f) {
  2.  
  3.       console.log("arquivo: " + f);
  4.  
  5.       const file = f.files[0];
  6.       const fr = new FileReader();
  7.       fr.onload = function(e) {
  8.         const obj = {
  9.           filename: file.name,
  10.           mimeType: file.type,
  11.           bytes: [...new Int8Array(e.target.result)]
  12.         };
  13.         console.log("file: " + obj);
  14.         console.log("nome do arquivo: " + obj.filename);
  15.         //google.script.run.withSuccessHandler(e => console.log(e)).saveFile(obj,destino);
  16.        
  17.         return obj;
  18.        
  19.       };
  20.       fr.readAsArrayBuffer(file);
  21.  
  22.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement