Create File URLs in JavaScript: Data URLs v Blob URLs
Вставка
- Опубліковано 1 сер 2024
- 🎓 NEW: Earn a professional certificate in web development from Meta Inc. (course links in card below) 👇
⚡ Need hosting for a website, WordPress blog or Node.js app? We use HostWithLove: bit.ly/3V2RM9Q ❤️
This tutorial shows you how to create file URLs in JavaScript in either Data URL or Blob URL format and when to use which method.
#javascript #javascript_tutorial #webdevelopment #frontend #tutorial
⚡Web development professional certificates from Meta Inc.⚡
Front-End Developer Professional Certificate: imp.i384100.net/b3dMek
Back-End Developer Professional Certificate: imp.i384100.net/gbYorg
iOS Developer Professional Certificate: imp.i384100.net/Jr7qj2
Meta Android Developer Professional Certificate: imp.i384100.net/oeYnGo
Meta Database Engineer Professional Certificate: imp.i384100.net/BX7KGB
I really like your content. Don't often see other tech youtubers making these obscure web api tutorials like you. Subscribed!
Thanks, glad you are liking the content. And really appreciate the sub!
I did sub you back. You mention that you are a tech youtuber...are you posting any videos soon? I'll watch out in case.
@@OpenJavaScript oh I am not a tech UA-camr (by other tech youtubers I meant other tech youtubers I subscribe to), just a lurker feel free to unsubscribe as I never post videos haha.
@@hideinbush0 Ah, I see 😂 I will keep the sub but limit my expectations then.
@@OpenJavaScript haha great, btw do you have a Twitter? Lots of tech devs I subscribe to have a Twitter account I regularly follow so I can keep up with latest trends, maybe having one could be helpful to get you more views 🤔
Finally, I saw the video! Learnt lots of new stuff, thank you!
Glad you liked the video, thanks for reaching out!
Thank you, sir. Your video really helped me in building my spring boot API project, I was struggling to convert byte file data to image in React. thanks again sir thank you
Such a great effort you're putting 😍keep this moral high👍 we're with you 🖤🖤❣️
Thank you, I really appreciate your message of support. Comments like this really help me to stay motivated to keep creating!
Even though it's not always easy it's been a great journey so far making this channel and I'm really pleased to hear that you are liking the content. This means a lot.
Appreciated ❤
Thanks!
Welcome, glad you liked it!
hi OpenJavascript (sorry i don't know your actual name) i really appreciate your efforts with JavaScript contents.. thank you so much, i'm grateful and i pray the GOD blessing will be overflowing in your life! take care
Thank you, I really appreciate your kind words! Glad you are finding the content useful and hope you'll stick around for what's coming up :)
Great video, i have a question about localstorage
Could i get the same result without using localstorage set and get?
only: ` img.src = url`
and what's the difference?
First, thanks so much for the feedback. Glad you liked the video!
To your question: yes, you can generate a URL (Data URL or Blob URL) and use it to set the src of an image directly on the page it is created. No need for localStorage in this case.
localStorage is useful if you want the image to be available if a user navigates to another page or returns for another visit. Then, you can store a Data URL in localStorage (it only works for a Data URL because it contains the image data represented in string format within it) and then you can retrieve it to set the src of an image beyond the page it was created.
Hope that clears things up?
I do have some other tutorials on localStorage in case you're interested:
Intro to localStorage: ua-cam.com/video/-ZRDZyUjEEI/v-deo.html
Passing an image through localStorage: ua-cam.com/video/XZ8CjU9eaVA/v-deo.html
Passing an object or array through localStorage: ua-cam.com/video/Txj88EreIp8/v-deo.html
@@OpenJavaScript thanks for your reply and the video about localStorage, i'll do more practices.
in this video you are only taking about images ... what about pdf files of around 20mb or more than that ... how to deal with this?