Base64 Encoding in JavaScript - Explained (with usage examples)

Поділитися
Вставка
  • Опубліковано 16 чер 2019
  • In this video I'll be taking you through Base64 when it comes to JavaScript and also demonstrate how you can use it to upload images.
    Support me on Patreon:
    / dcode - with enough funding I plan to develop a website of some sort with a new developer experience!
    For your reference, check this out:
    developer.mozilla.org/en-US/d...
    Follow me on Twitter @dcodeyt!
    If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

КОМЕНТАРІ • 38

  • @freelancefabian3946
    @freelancefabian3946 3 роки тому

    Well done, concise and to the point .

  • @photoinshot1355
    @photoinshot1355 Рік тому

    Brilliant! Thanks! I have been looking for a good tutorial on this for ages, should have come here first, very clear and well explained tutorial, as ever, thanks!

  • @maheshmahi5455
    @maheshmahi5455 3 роки тому

    I like the way u explained and i subbed

  • @MW-fm1qq
    @MW-fm1qq 3 роки тому +1

    Thanks for your efforts!

  • @kuldeep7063
    @kuldeep7063 Рік тому

    Thanks Brother

  • @aghahasaan
    @aghahasaan 3 роки тому +1

    Thanks a lot man!!!!

  • @amoljore7
    @amoljore7 4 роки тому +2

    Hey decode hey, thanks for tutorial...but in react using webcam how to pass or convert base64 to binary..then send to server

  • @bikramchettri9405
    @bikramchettri9405 5 років тому

    Hey Dom can you please do a video on map-set-weakmap-weakset and map vs object?

  • @cristophercanoles3827
    @cristophercanoles3827 4 роки тому

    Hey master, how to display base64 PDF in IE 11, is supported?

  • @jeevanstha57
    @jeevanstha57 2 роки тому +1

    Can you make a video for converting multiple image upload by user to base64 and store to single row of database in php,mysql

  • @RA-fj4qk
    @RA-fj4qk 2 роки тому

    Nice video. What color theme are you using?

  • @MikeWilkesPhoto
    @MikeWilkesPhoto Рік тому

    Nice! What does the Upload.php look like to accept the image using this method?

  • @robogenus
    @robogenus 4 роки тому +1

    Hi dcode, wow thanks for this tutorial. It was very well explained and a very good demo. I'm glad I just discovered your channel. Now I can checkout what other cool tuts you might have. Sub/d :D

  • @Kunal-jp8tn
    @Kunal-jp8tn 2 роки тому

    Please tell which keyboard are you using... It sounds pretty awesome....

  • @chamansos7895
    @chamansos7895 4 роки тому

    hi, where can do download code soruce?

  • @vinubox
    @vinubox 4 роки тому

    Cool :)

  • @mr.rendero1240
    @mr.rendero1240 3 роки тому +1

    Hey dude, nice video, very informative. Uhmm is it okay if I use base64 for encoding complex JSON objects and passing them in data-attribute via html, to be used let's say in the next page ? Is that a bad practice and if so... what other alternatives can you recommend ? Thank you :)

    • @dcode-software
      @dcode-software  3 роки тому +1

      I just did a quick Google search and it looks like there's no limit on how much data you can store in an HTML attribute so you should be okay

    • @mr.rendero1240
      @mr.rendero1240 3 роки тому

      @@dcode-software Got it, thank you :)

  • @ruixue6955
    @ruixue6955 2 роки тому

    3:02
    4:09 js: create convas
    6:30

  • @techwithshudarsan559
    @techwithshudarsan559 3 роки тому

    Thanks.

  • @rahmankhanrajak6745
    @rahmankhanrajak6745 4 роки тому

    help me to Image to base 64 in java script

  • @user-vv9lz2ik2t
    @user-vv9lz2ik2t 3 роки тому

    Great

  • @TheSclare
    @TheSclare 5 років тому

    Very good, but can we send the base64 data securely, protect from "man in the middle" attacks?

    • @dcode-software
      @dcode-software  5 років тому +1

      It's not supposed to conceal data so any security methods you're trying to implement you should treat Base64 like it was plaintext.

    • @octavioperez9835
      @octavioperez9835 4 роки тому

      TheSclare

  • @zhenghaohe4727
    @zhenghaohe4727 3 роки тому +1

    You don't have to use base64 to encode image files as it increases the size of the message and it's not necessary. Also HTTP can transfer non texual data. The body of a request or response is an arbitrary sequence of bytes. It's mainly intepreted by the application, not by the HTTP layer. It doesn't need to be in any particular encoding. The header has a Content-Length field, and the client simply reads that many bytes after the header.

  • @developeraccount438
    @developeraccount438 4 роки тому +4

    I listen your typing sounds only...tk tkkkk tlkkkkk wooowww

  • @veeragali97
    @veeragali97 3 роки тому

    But it not working in firefox browser man

  • @kurt9754
    @kurt9754 4 роки тому +1

    so.

  • @cristianfigueredo566
    @cristianfigueredo566 Рік тому

    this don't work in NodeJS, you can use this approach: Buffer.from(YOUR_STRING, "binary").toString("base64");