Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <input type='file' onchange='openFile(event)' id="EdituserProfileImage">
  2.  
  3. var fileName;
  4. var filetype;
  5. var filesize;
  6. var VoiceBase64;
  7. var openFile = function (event) {
  8. var input = event.target;
  9. fileName = input.files[0].name;
  10. filetype = input.files[0].type;
  11. filesize = input.files[0].size;
  12. console.log(input);
  13. console.log(fileName);
  14. var reader = new FileReader();
  15. reader.onload = function (evt) {
  16. var voiceInBinay = evt.target.result;
  17. VoiceBase64 = btoa(voiceInBinay);
  18. contvertBase64toBinaray(VoiceBase64);
  19. };
  20. reader.readAsBinaryString(input.files[0]);
  21. };
  22.  
  23. function contvertBase64toBinaray(VoiceBase64) {
  24. var audiofile = atob(VoiceBase64)
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement