Vue Image Upload Made Easy

  Рет қаралды 230,043

Academind

Academind

6 жыл бұрын

Vue.js is a JavaScript framework that allows us to build highly engaging web apps.
Uploading images (or file upload in general) is a common requirement that can be difficult to implement. It doesn't have to be!
----------
Find the video and an article on: academind.com/learn/vue-js/sn...
Dive into Vue.js: acad.link/vuejs
----------
• You can follow Max on Twitter (@maxedapps).
• And you should of course also follow @academind_real.
• You can also find us on Facebook.( / academindchannel )
• Or visit our Website (www.academind.com) and subscribe to our newsletter!
See you in the videos!
----------
Academind is your source for online education in the areas of web development, frontend web development, backend web development, programming, coding and data science! No matter if you are looking for a tutorial, a course, a crash course, an introduction, an online tutorial or any related video, we try our best to offer you the content you are looking for. Our topics include Angular, React, Vue, Html, CSS, JavaScript, TypeScript, Redux, Nuxt.js, RxJs, Bootstrap, Laravel, Node.js, Progressive Web Apps (PWA), Ionic, React Native, Regular Expressions (RegEx), Stencil, Power BI, Amazon Web Services (AWS), Firebase or other topics, make sure to have a look at this channel or at academind.com to find the learning resource of your choice!

Пікірлер: 250
@ChaseGatyas
@ChaseGatyas 3 жыл бұрын
Always appreciate the concise and accurate tutorials but taking it a step further and showing the loading percentage was awesome. Thanks
@Bundynational
@Bundynational 4 жыл бұрын
this has been one of the most helpful coding videos I have ever watched. Thank you.
@chris-uit-balen
@chris-uit-balen 3 жыл бұрын
Dear Max, today I spend hours upon hours without success trying to get a file upload from Vue.js into a Laravel controller. And then, I found this magnificent video tutorial that got me sorted out straight away. Ten or so lines of code WOW! Thanks, you made my day! Chris
@marca6982
@marca6982 6 жыл бұрын
Amazing. Your videos allow the developer to save so much time. The refs functionality is a Bonus from this video, didn't know it at all ! Thanks.
@academind
@academind 6 жыл бұрын
Thanks so much, that's really amazing to read! :)
@monax44monax
@monax44monax 4 жыл бұрын
I was looking for "how to keep images in server for vue", but this video expanded my knowledge about vue, ty :)
@RaymondAtivie
@RaymondAtivie 6 жыл бұрын
Max. This was a great video. Exactly what I needed. Thank you so much
@academind
@academind 6 жыл бұрын
Really great to read that it came at the right point in time Raymond thank you very much!
@wduandy
@wduandy 2 жыл бұрын
I love it! The firebase functions was a new thing for me! Thank you.
@hollywoodmedia2023
@hollywoodmedia2023 Жыл бұрын
I havent leant more in a nine minute video than an entire 3hr video i watched thank you
@clintjames5666
@clintjames5666 6 жыл бұрын
I started my Vue.js path based on your vids. Thank you and keep up the great work, Max!
@academind
@academind 6 жыл бұрын
Thank you very much for sharing this Clint, really means a lot to me to read that my videos are part of your Vue journey :)
@DiegoTejada
@DiegoTejada 5 жыл бұрын
Extremely punctual and easy, thank you so much Max!!
@academind
@academind 5 жыл бұрын
So happy to read that Diego, thank you very much for your comment!
@Manusaurius
@Manusaurius 5 жыл бұрын
Omg, thank you so much for this tutorial. I was stuck in file upload with vue and this save my work. Thank you.
@academind
@academind 5 жыл бұрын
Thank YOU for your awesome feedback Manuel :)
@SHISHIRLIKESIT
@SHISHIRLIKESIT 5 жыл бұрын
Thanks for the tutorial. You really made it simple!
@panmike138
@panmike138 5 жыл бұрын
when i test, error : has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
@hemicar92
@hemicar92 5 жыл бұрын
Hi Max great tutorial. Can you tell me how can I after image is uploaded show it in the component? How do I pick the downloadURL from firebase storage and insert that as image src ?
@dayoutubegame1725
@dayoutubegame1725 2 жыл бұрын
you are "THE MANNNNNN" dude thanks to you i've been fixing an issue i had for 3 days, i didnt know how to properly make this sending files to the backend, i'm a noob dev i'm learning and i'm trying to finalize a project and thanks to you i'm maybe 10% closer to the end , but 10% is huge, i have less than 15 days left thankk youu!!! i will add something for those who might have the issue i have, im working on node js, express, vue,axios,multer. i'm just gonna say this . front: var formData = new FormData(); formData.append('',this.new_attachments) back: app.post('/upload', upload.single(''),... has to be the same, otherwise you get errors!!! i hope some of you understand it might help
@tomosterlund6497
@tomosterlund6497 3 жыл бұрын
This was very helpful! Sometimes I spend an hour or even a few on stackoverflow trying to solve a problem. Then sometimes after a 10-minute video from you, or after shortly going back to one of your courses => problem solved.
@abelherrera722
@abelherrera722 3 жыл бұрын
you made it simple and fast, thanks!
@jojojawjaw
@jojojawjaw 6 жыл бұрын
So, like I leave a like right after I start any vid on your channel, even before seeing it; your tutorials are awesome, man. YOU are awesome.
@academind
@academind 6 жыл бұрын
Thanks so much for your absolutely fantastic feedback and for your great support Sarah, YOU are awesome :)
@mindfluxmindflux6306
@mindfluxmindflux6306 5 жыл бұрын
more and more often I end up on your channel, thx for the great videotutorials!
@academind
@academind 5 жыл бұрын
Happy to have you on board, thanks a lot for your great feedback!
@chris-uit-balen
@chris-uit-balen 3 жыл бұрын
I saw you have an extensive course program; so I just enrolled for the Vue.js course! Good value for money, thanks!
@anthonypetruzzi158
@anthonypetruzzi158 3 жыл бұрын
OMG!!! Talk about easy and well explained. Echoing Marc A. that the refs portion blew my mind 😍😘🥰
@alisultani1182
@alisultani1182 6 жыл бұрын
Hi Max. How would you send json data along with that request so you can fetch it on the server. eg Node.js using body-parser?
@scottmcmahon7209
@scottmcmahon7209 3 жыл бұрын
Is it a good idea to compress the image and resize it on the client side or the server? Also do you have any videos that teaches how to do this?
@lucasb773
@lucasb773 6 жыл бұрын
Is there a simple way to check if the uploaded file matches a specific file type with vue/axios or do you need to do that on the backend?
@quanvotangky8118
@quanvotangky8118 5 жыл бұрын
Where is the link to the firebase function video because I don't see them anywhere in the description?
@ultrasamad
@ultrasamad 6 жыл бұрын
Hi Max thanks for the tutorial. When uploading image to aws with laravel as the backend and using axios with vue, I find it difficult implementing the progressbar. If it's however from axios straight to aws it's pretty clear. Can you show how this will be done with Laravel. ie axios => laravel => aws. Thanks.
@Vlad-em1bx
@Vlad-em1bx 4 жыл бұрын
Thank you for the video. It helped me solve my problem.
@seoyunjung9431
@seoyunjung9431 2 жыл бұрын
How nice and clear! Thanks for your tutorial
@BikingBas
@BikingBas 3 жыл бұрын
Great video! Only, I don't have the firebase cloud function that you show. How can I make sure to get it? Do I need to write it myself or is there a plugin I can download or something?
@theophilusaika1215
@theophilusaika1215 6 жыл бұрын
Hi, tried to use vue-avatar-editor to crop the image while uploading it, but I'm getting base64 version of the image which may not be the best for database storage. Can't access it with FormData() either. Any help?
@martinnilsson2145
@martinnilsson2145 5 жыл бұрын
I can't get the @change to work. Do I need minimum version of Vue or something? It seems I can't ask the correct question on Google cause I don't find any information about this.
@dirceudev2697
@dirceudev2697 3 жыл бұрын
Very good! It's a very clear explanation. Great! Thank you!
@isaacaranas5156
@isaacaranas5156 4 жыл бұрын
Hey great Tutorial!!! Please do more!!! Thank you!!!
@ttnghia195
@ttnghia195 6 жыл бұрын
Hi Max! How i can get image URL after upload? Thanks
@jesuserwinsuarez65
@jesuserwinsuarez65 5 жыл бұрын
This is great! thank you.
@abeebayinla4858
@abeebayinla4858 Жыл бұрын
Thanks for this video. What if in the case where an API endpoint is expecting the file in form of binary how do you go about it.
@alsemany
@alsemany 4 жыл бұрын
Thank you so much that's helps me a lot
@IlIlIlIIIlIll
@IlIlIlIIIlIll 4 жыл бұрын
Aha but what if I wanted a custom button? Done. but what if I wanted to get the upload progress? Done This tutorial is truly epic
@sanyuktakate4099
@sanyuktakate4099 3 жыл бұрын
Thanks for this video. How can we display/preview the image immediately after uploading it? As in how can we access the url stored in AWS or any other server?
@danielnavarro7447
@danielnavarro7447 2 жыл бұрын
Thanks for the tutorial, it really helped me :D very helpful!!!
@Sunil-kq9bx
@Sunil-kq9bx 5 жыл бұрын
when i do this and click on the button it refreshes my page before it opens the file input... also upon selecting a file it doesn't call the onFileSelected(). but when i only use the input field everything works fine. what am i doing wrong here?
@crashoverride9681
@crashoverride9681 5 жыл бұрын
Very clear and nice explaining! Respect bro! You are teacher of 80 level! =)
@academind
@academind 5 жыл бұрын
Very happy to read that, thanks a lot :)
@jonathanzarate7255
@jonathanzarate7255 4 жыл бұрын
Hi, thanks for video. I have a question. How can send image file with axios without use formData?
@PabloGaraguso
@PabloGaraguso 6 жыл бұрын
Excellent. Clear and to the point. Good video. Thanks!
@academind
@academind 6 жыл бұрын
Happy to read that you liked my explanation Pablo, thank you very much!
@wilfredmacaulay5797
@wilfredmacaulay5797 6 жыл бұрын
Great tut as always. Way to go Max!
@academind
@academind 6 жыл бұрын
Thank you very very much Wilfred :)
@manojthayil7836
@manojthayil7836 7 ай бұрын
Amazing Video Max. Do you know any popular Vue Plugin , that you might have used in the past for file upload.
@modevogl
@modevogl 4 жыл бұрын
does anyone know, if the file could also be moved to a specific folder on the clients computer instead of uploading it to a backend db? my project includes a folder with 5 demo songs that can be replaced by the user (as taste is different) and i cant store everyones 5 songs on the backend, so i need to make sure the files are in that specific folder on the frontend. otherwise my functions will not work. is that possible with js?
@salinderru
@salinderru 4 жыл бұрын
Max thank you !!! You are the best!
@leandrorodriguez5134
@leandrorodriguez5134 3 жыл бұрын
I have a very important question, which is the type that you recive on the server? IFORMFILES?, because it's doesn't work! I have this problem when i send from parameter the formdata: "file": [ "Could not create an instance of type Microsoft.AspNetCore.Http.IFormFile. Type is an interface or abstract class and cannot be instantiated. Who is the code to recive this formdata in your api? Have you an example? Thks
@EldaldGael
@EldaldGael 6 жыл бұрын
if you want upload image from server django (django rest framework) only use multiparse and formparse
@ashankraju1043
@ashankraju1043 2 жыл бұрын
Which platform u were using
@lingting9790
@lingting9790 3 жыл бұрын
Hi, i have some problem on the submit the form data with optional image upload. The user can submit the form data eventhough did not choose the image/file. How can do that? Backend is laravel
@johnrobertsonnocos2996
@johnrobertsonnocos2996 5 жыл бұрын
Hey Max! Awesome tutorial once again!
@academind
@academind 5 жыл бұрын
Thanks a lot John!
@midhunmohan5112
@midhunmohan5112 5 жыл бұрын
I am not getting response from server, {data: {…}, status: 200, statusText: "OK", headers: {…}, config: {…}, …} Only this thing, what should I do? Image is entering in database, but response is null
@slaincore
@slaincore 6 жыл бұрын
Hello from CIS :), your lessons are awesome!
@academind
@academind 6 жыл бұрын
Thanks a lot, so great to read that!
@hamadasaidi9202
@hamadasaidi9202 6 жыл бұрын
your Videos so far Helped me alot thanks man !
@academind
@academind 6 жыл бұрын
That's so cool to read Hamada, thank you very much for your comment!
@nightlifeking
@nightlifeking 4 жыл бұрын
What a well done video! Bravo!
@touch5094
@touch5094 5 жыл бұрын
Hi, Do u know how to upload file vue laravel without append form data ?
@anuwatjantarawong9557
@anuwatjantarawong9557 3 жыл бұрын
Understood,This is great! thanks.
@evgenybaraboshkin2375
@evgenybaraboshkin2375 4 жыл бұрын
Thank you! And what is the way to download the file back?
@ozanmuyes
@ozanmuyes 6 жыл бұрын
Hi Max, thanks for the video. I am wondering about the lag between 100% and response console logs. Is it because the Firebase (cloud functions to be exact)?
@academind
@academind 6 жыл бұрын
Indeed, the file needs to be stored on the Firebase servers after it was uploaded to the cloud function - that's basically the extra time you have to wait.
@placidwaves
@placidwaves 5 жыл бұрын
Any reason why FileData object would be empty after calling append?
@Xiaoxooooo
@Xiaoxooooo 5 жыл бұрын
Thank you so much for this great tutorial!
@academind
@academind 5 жыл бұрын
Happy to read that you like it Mark, thank you very much!
@kalankasiyambalapitiya7615
@kalankasiyambalapitiya7615 6 жыл бұрын
Thanks Max for the vid ....can you do a video for separation of service layer for this one ...cheers!!!
@RealWorldMusicTheory
@RealWorldMusicTheory 6 жыл бұрын
Great video - right to the point! Thanks! Is there a reason why you use a custom cloud function instead for fireball.firestore() directly? I would fear that using custom Ajax calls might break things like offline functionality for firebase, because it can’t handle caching and syncing for custom Ajax calls.
@academind
@academind 6 жыл бұрын
I simply wanted to show a generic approach, not one only working with Firebase. I just used Firebase as it's easy to set up and doesn't require me to write a lot of boilerplate backend code.
@ritimodoscrias7025
@ritimodoscrias7025 4 жыл бұрын
voce sabe me dizer se e possivel mostrar a imagem antes de enviar pro firebase?
@kelvinzhao4960
@kelvinzhao4960 3 жыл бұрын
Is it possible to use fetch to do this?
@ponchonolasco1496
@ponchonolasco1496 5 жыл бұрын
Thank you, this video has really helpful to complete a task.
@academind
@academind 5 жыл бұрын
That's great to read Poncho, thank you very much for sharing this!
@k9999k1
@k9999k1 4 жыл бұрын
Do you have any video to upload file from laravel6 to s3 aws?
@dalandan8300
@dalandan8300 4 жыл бұрын
Thank you. Its very helpfull and easy to understand. I subscribed because of this
@academind
@academind 4 жыл бұрын
Thanks for the sub!
@jorgebee65
@jorgebee65 4 жыл бұрын
Do this works from a mobile device?
@LucTemetNosce
@LucTemetNosce 4 жыл бұрын
Great tut. Thx
@jackb6106
@jackb6106 3 жыл бұрын
Does this work with firestore?
@taewookkang2121
@taewookkang2121 3 жыл бұрын
This is so cool!! thanks a lot
@CarlosCasalicchio
@CarlosCasalicchio 4 жыл бұрын
I'm using vue-resource, and got the console.log(%) working, but I want to update an HTML progress bar. How can I access it? The this.percent and this.progressBar are not really updated this.$http.post(`${process.env.ROOT_API}${this.photo_endpoint}`, formData, { headers: { 'Content-Type': 'multipart/form-data' }, progress (e) { if (e.lengthComputable) { this.percent = Math.round(e.loaded / e.total * 100) this.progressBar = this.percent + '%' console.log(this.progressBar) } } } ).then(response => { ...
@dipeshhkc
@dipeshhkc 6 жыл бұрын
Awesome Max :) ......waiting for other vuejs related videos
@academind
@academind 6 жыл бұрын
Thank you very much! I'll probably release more Vue videos in the future (got no concrete plans right now though).
@israelsousa
@israelsousa 4 жыл бұрын
Amazing, thanx for the video
@anonymousghost5384
@anonymousghost5384 3 жыл бұрын
In django should we use request.FILES??
@adeosunoluwafemiomoniyi
@adeosunoluwafemiomoniyi 6 жыл бұрын
MAX, if you by chance visit Nigeria, know that you have a big fan. Your videos are :fire:, super great. Thanks for doing what you are doing. By the way, pls come visit Nigeria.
@academind
@academind 6 жыл бұрын
Thank you very much for your great comment! Unfortunately I won't be able to visit Nigeria in the near future, but greetings from Germany :)
@twinsSpark
@twinsSpark 4 жыл бұрын
Amazing max. please make a video with cloudenery image upload.
@TheKidrock1988
@TheKidrock1988 2 жыл бұрын
this.selectFile = event.target.file[0] showed me this error {Cannot read properties of undefined (reading '0')}.
@aditigupta1469
@aditigupta1469 6 жыл бұрын
Hi Max! Great tutorial! Is there any way to show upload progress in a bar instead of showing percentage in the console?
@academind
@academind 6 жыл бұрын
You can of course manually translate it. Update some Vue instance data property and then write some template code to update some CSS styles based on that
@webnostix5256
@webnostix5256 6 жыл бұрын
Max another great video thanks, One question though. I followed your REST API tutorial series and wanted to test the file upload with that. The only issue is that I am having issues sending the bearer token in the header to authenticate using axios. Any pointers with that would be greatly appreciated - best :-)
@academind
@academind 6 жыл бұрын
Do you have issues with attaching it to the Axios request or handling it on the server? Attaching it should be possible via axios.post('url', data, { headers: {Authorization: 'the-token'}}
@webnostix5256
@webnostix5256 6 жыл бұрын
i used axios.post('url', data, { headers: {Authorization: 'Bearer' + 'the-token'}} the same as in postman, but get a 404 error, is this wrong?
@bttstudio5543
@bttstudio5543 5 жыл бұрын
Thanks for the video, really informative. I have a request, can you do a tutorial of file upload with vue filepond and laravel?
@bladimirHC15
@bladimirHC15 3 жыл бұрын
alguien sabe que ruta debo de poner, eh puesto una hacia mi carpeta images, pero me da error
@maskman4821
@maskman4821 3 жыл бұрын
This is really awesome !!!
@nicoladivenere8353
@nicoladivenere8353 4 жыл бұрын
Where is the video to create the function?
@m3rl1on
@m3rl1on 3 жыл бұрын
but what if i want to upload multiple images?
@patelsiddhant994
@patelsiddhant994 3 жыл бұрын
Thank you
@JoelPiccoli
@JoelPiccoli 6 жыл бұрын
Great video man! Thanks a lot!
@academind
@academind 6 жыл бұрын
Happy to read that you like it Joel, thanks a lot for your comment!
@danielouattara3857
@danielouattara3857 3 жыл бұрын
Merci beaucoup. Super !
@micheleckhardt6067
@micheleckhardt6067 3 жыл бұрын
Do you can send the code to the github?
@benhummer185
@benhummer185 3 жыл бұрын
Thanx, man!
@123deplsmiei
@123deplsmiei 5 жыл бұрын
hey! What are the font and the theme which you're using... I also want the text color contrast. I'm one of your student from Udemy!
@academind
@academind 5 жыл бұрын
I use this VS Code setup => academind.com/learn/web-dev/visual-studio-code-introduction/#our-visual-studio-code-setup
@ritimodoscrias7025
@ritimodoscrias7025 4 жыл бұрын
Please, helpme, how use with cropper,js?
@last_hope_hero
@last_hope_hero 5 жыл бұрын
Lot of thanx comrade ! )
@laagodfather4435
@laagodfather4435 2 жыл бұрын
I love you man thanks a lot
@kalmenchia
@kalmenchia 5 жыл бұрын
Thanks , the sharing is very helpful. May i ask , if i wish to encode the upload file to a base64 before upload it, how can i do that ? is there any example of how this can be done in vuejs , the process is the same , the user pick the file , click the upload button, but it will upload it as a base64 string .
@TheBlackWarriorLP
@TheBlackWarriorLP Жыл бұрын
i need this too
@rx596
@rx596 4 жыл бұрын
Great tutorial Max, it helped me a lot! Has someone told you how much you look like Officer Hopper from Stranger Things? xD
@academind
@academind 4 жыл бұрын
No, that's new to me, I just know the Seth Rogan comparison :D
@shahmirjadoon1322
@shahmirjadoon1322 6 жыл бұрын
MAX, how many years should I spend to be like a Maximillian 2 ?? You are awesome ... Max help us in uploading multiple images and also preview images before upload. It will really be helpful
@academind
@academind 6 жыл бұрын
I spent 15 years ;) Just kidding - thankfully I still learn so much every day, that's what web development is all about in the end. Keep on learning. Happy to hear that I can help you with that a bit :)
Nuxt.js - Introduction by Project
55:04
Academind
Рет қаралды 212 М.
Upload Files with Vue and Express #01: Vue Upload Form
13:32
Rem Zolotykh
Рет қаралды 42 М.
That's how money comes into our family
00:14
Mamasoboliha
Рет қаралды 9 МЛН
Vivaan  Tanya once again pranked Papa 🤣😇🤣
00:10
seema lamba
Рет қаралды 34 МЛН
You might not need useEffect() ...
21:45
Academind
Рет қаралды 153 М.
Laravel Vuejs Upload Multiple Images with Filepond
31:12
Tony Xhepa
Рет қаралды 4,9 М.
Vue 3 Composition API Introduction [FULL TUTORIAL]
23:46
Academind
Рет қаралды 172 М.
Vapor: The Future Of Vue
21:27
Theo - t3․gg
Рет қаралды 112 М.
VSCode is Not Enough Anymore in 2024
3:21
Dev Panda
Рет қаралды 7 М.
What is JWT? JSON Web Tokens Explained (Java Brains)
14:53
Java Brains
Рет қаралды 1 МЛН
Vue 3 & A First Look at the Composition API
44:41
Academind
Рет қаралды 94 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 956 М.
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 6 МЛН
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,6 МЛН
После ввода кода - протирайте панель
0:18
Up Your Brains
Рет қаралды 1,2 МЛН