JavaScript File System Access API Tutorial - Read, Write and Save Files

Поділитися
Вставка
  • Опубліковано 31 лип 2021
  • In this short video we'll take a look at the new File System Access API, which currently has limited browser support.
    Documentation: developer.mozilla.org/en-US/d...
    Browser support: caniuse.com/native-filesystem...
    Thanks to my Patreon supporters who help make these videos possible: / codepulse
  • Наука та технологія

КОМЕНТАРІ • 63

  • @damienscullytoo
    @damienscullytoo 3 роки тому +58

    Okay, that was pretty damn cool when you started coding in browser to get a function you needed for the next step. Really smart demonstration

    • @olivyae3057
      @olivyae3057 Рік тому +3

      I just caught on to that. So cool :)

  • @edwardwilson4272
    @edwardwilson4272 2 роки тому +7

    Fantastic vid. Short and sweet. Have been wondering how to work with files and JS for some time. Thank you!

  • @edilsonjunior8161
    @edilsonjunior8161 2 роки тому +7

    Man, this is a dream. A solution for local apps. Thanks dude.

  • @Tabbytoffee
    @Tabbytoffee Місяць тому

    Wow! you just nonchalantly created a turing complete text editor in a 4 minute video.
    Thanks so much!

  • @akrit.ghimire
    @akrit.ghimire Рік тому +2

    Amazing and so simplified. Thank you!!!!

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

    Impressive ..
    I hope u continue JavaScript tutorial
    and about indexed-database and broadcast- channel .. all about system files and streams
    this is basics of advanced JavaScript
    thanks for u

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

    My mind has just exploded and you just gained 1 sub.

  • @heeju4482
    @heeju4482 Рік тому +2

    This video is really helpful! Thank you :)

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

    Thanks this was Helpful

  • @magbenyo
    @magbenyo 3 роки тому +2

    I will start learning web development next year 😊

  • @omkarbhale442
    @omkarbhale442 2 роки тому +2

    OK, a video that explains file system API cant be better than this.

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

    Very helpful. Thanks

  • @tothg77
    @tothg77 2 місяці тому

    Thank you so much!

  • @emmanuelakigbogun1970
    @emmanuelakigbogun1970 10 місяців тому

    Who is this guy .. this is awesome😅🎉 thanks man

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

    Amazing!!! Thanks , I was wondering if I can upload and read couple of files? Thanks

  • @RealmOfCode
    @RealmOfCode 2 роки тому +2

    What about the file's path? I tested this API with an image file, but I can't get the reference to the path for the selected image file. I can console.log fileData and I am able to see a "path" property, but it's always blank.

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

    Great video!

  • @RunningtoCatchMyBreath
    @RunningtoCatchMyBreath Рік тому +2

    I like you your added a gratuitous shit on python at the end. Keep that up

  • @AndiAbrudan
    @AndiAbrudan 3 роки тому +7

    I couldn't help but notice that you inserted a tab in a textbox at 2:58
    How did you do that? Usually, tab just cycles to the next element on the page

    • @CodePulse
      @CodePulse  3 роки тому +22

      I copied a tab character from my text editor and used ctrl+v every time I wanted to indent 😁

  • @damienscullytoo
    @damienscullytoo 3 роки тому +5

    Also compared to your other videos this one is pretty quiet so just a heads up

  • @LucasAlfare
    @LucasAlfare 3 роки тому +4

    Show some binary manipulation over files as well if possible

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

    I left JavaScript 22 years; and i didn’t know will be popular.

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

    Is it possible to open file without propting new oprn file window?

  • @codewithalade5399
    @codewithalade5399 3 роки тому +2

    Plz, try to make this kind of videos for javascript.

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

    Not selecting a directory is a feature rather than a bug of showOpenFilePicker() vs a forthcoming showOpenDirectoryPicker()? The mozilla documentation doesn't seem to address this currently.

  • @adolphineatingchildren2641
    @adolphineatingchildren2641 11 місяців тому +2

    this tutorial is great, but a lot of browsers don't support this API

  • @i-ahmed3495
    @i-ahmed3495 Рік тому

    when I click save it says
    Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'createWritable')
    how to fix it?

  • @RanjithKumar-rp7xi
    @RanjithKumar-rp7xi 2 роки тому +1

    While downloading files, can we able to save the directory path during first time and for second time can we directly point download to existing directory path without selecting paths for second time

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

      That's a good question. I've tried looking this up and the best solution I could find is to store the fileHandle in localStorage which can then be retrieved after page reload. Note that another permission prompt may appear. stackoverflow.com/questions/64856292/persist-file-descriptor-across-page-reload-in-chrome-with-filesystemfilehandle

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

    how to get the file and folder list in sidebar

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

    Q: how to get directory path in javascript? thanks

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

    Can't wait for and IDE i don't have to install

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

    UNIQUE

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

    Does this work in Android chrome?

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

    For save every time prompt was showing how to solve that

  • @rauchu5861
    @rauchu5861 3 місяці тому

    what are the limits to this?

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

    Can I use the api in asp.net? How?

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

    best men

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

    why there is square bracket in file handle please someone can u explain in detail

    • @CodePulse
      @CodePulse  2 роки тому +2

      The function returns an array, and the file handle is the first element of the array. I used special JavaScript syntax called "array destructuring" to get the first element from the array.

  • @rdawo6408
    @rdawo6408 Рік тому +1

    This is awesome for desktop apps but what about mobile ones 😢😢😢😢

  • @kamoroso94
    @kamoroso94 Місяць тому

    If only this had full cross browser support.

  • @hotdrogon9350
    @hotdrogon9350 3 роки тому +4

    Bro Make the Video series for Assembly Language Please. Thanks 😘

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

      ua-cam.com/users/WhatsACreel

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

    Hi but for me it makes a txt.crswap file

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

    the save function dont work :(

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

    the innerText won't load for me everything works but that

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

      Did you create an element with id="textarea"?
      You may also want to try `let textarea = document.querySelector("#textarea");` on the previous line.

  • @CrazyAssDrumma
    @CrazyAssDrumma 10 місяців тому

    JS is the better language. Thankyou :D

  • @lazykid9167
    @lazykid9167 2 роки тому +2

    inception bro....

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

    I feel dumber than before

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

    like

  • @secondengineer9814
    @secondengineer9814 3 роки тому +3

    I'd like to request a Python video, as it is a better language than javascript :)

    • @marvin.toyboy
      @marvin.toyboy 2 роки тому +3

      It's not better haha. It's slower and use more energy.

  • @Daniel-pg8ln
    @Daniel-pg8ln 2 роки тому

    Thank you so much!!!