Chunked File Upload with React and Express.js

  Рет қаралды 19,355

Coding With Dawid

Coding With Dawid

Күн бұрын

Пікірлер: 53
@StefanGraf2
@StefanGraf2 2 жыл бұрын
This was a great help to make my own React component to upload very large files (4+ gb) in chunks instead of one big file.
@CodingWithDawid
@CodingWithDawid 2 жыл бұрын
For sure. I think browsers would struggle to upload this much in one chunk. And there would be some limitations on the backend server too
@StereoWorld
@StereoWorld 2 жыл бұрын
Big fan of your videos sir. But i wonder why haven't you gained so popularity like others do, makes me feel sad to see a talented web developer with such less recognition.
@CodingWithDawid
@CodingWithDawid 2 жыл бұрын
I guess it will come with time 🤷🏻‍♂️ Until then I want to thank you for your kind words. It motivates me to stay consistent and to create more videos for people like you. I hope you learned something useful from my videos that will help you to build something awesome in the nearest future! Take care and keep coding!
@adityadubey2488
@adityadubey2488 3 жыл бұрын
Always making sure to like and comment.
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
Thank you! 🙂
@promods96
@promods96 2 жыл бұрын
Hi Dawid, Thank you so much for the content. One small doubt, after slicing the file any reason why we are using readAsDataURL? Can't we just directly send the sliced blob ?
@turki8542
@turki8542 2 жыл бұрын
lets say i want to have my back-end with Django. how can i do it?. Thanks
@turki8542
@turki8542 2 жыл бұрын
thank you so much man for this video but i want to know what if i want to send this info to a database and from the database back to the ui how can i take the bytes from the database and convert it to display it on the screen? thanks.
@CodingWithDawid
@CodingWithDawid 2 жыл бұрын
You shouldnt put files into a database. Use s3 or something similar for file storage and then store s3 links in your database
@ropen81
@ropen81 2 жыл бұрын
Great content! Is there any reason why you chose to send the data using readAsDataURL instead of readAsArrayBuffer?
@CodingWithDawid
@CodingWithDawid 2 жыл бұрын
I like to send encrypted blobs/binaries to see whats its actually sent in more human readable format
@ropen81
@ropen81 2 жыл бұрын
@@CodingWithDawid Thanks!
@tahaahmadi7446
@tahaahmadi7446 Жыл бұрын
Hi Dawid, at first thanks you so much for sharing your skills with us, for this code, after uploading whenever I want to stream it It doesnt work, also file size after upload is not same the orginal file
@araxyso
@araxyso 3 жыл бұрын
Can you try to make it so it’s compatible with iPhones like where you click the box it’ll become a button then it’ll show like options to use your iPhones file manager or browser some where?
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
You can just put a instead of the drop area or inside the drop area. The events are most likely the same for the inout as they are for the dropzone
@araxyso
@araxyso 3 жыл бұрын
@@CodingWithDawid ah alright thanks
@aashishpaudyal5306
@aashishpaudyal5306 3 жыл бұрын
Is it gurenteed that the file chunks are received in order? If it doesnot then file won't be currupted ?
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
Yes. The next chunk/part will not start uploading before the previous one is not succesfully uploaded
@RogerioTadim
@RogerioTadim 2 жыл бұрын
owesome!
@korogomo4583
@korogomo4583 2 жыл бұрын
good job man
@CodingWithDawid
@CodingWithDawid 2 жыл бұрын
Thank you!
@david-tracy
@david-tracy 3 жыл бұрын
Great. Do u suggest uploading a zip file this way? ... or is this approach more for live streaming types of applications..? The zip file has multiple files in it (in case that info helps to determine an answer). The zip file that contains source code for a medium/small sized application. I want to upload the zip to my server / storage.
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
Yes. It should work with zip files too! 🙂
@david-tracy
@david-tracy 3 жыл бұрын
@@CodingWithDawid thank u man. I appreciate it!
@chawza8402
@chawza8402 2 жыл бұрын
on iterating the chunks, why do you use useEffect? not a simple loop? What I see it's really complicated that you track the chunk index using states and useEffect where you use every where. I'm still trying to understand your code and it seems there is there is something obvious that I miss. What in my mind is that, in the client side, we can iterate the sliced blob inside the readAndUploadChunks() which inside use axios that sends the chunk. Although I learn alot on the backend part where you ssave each chunk temporarily on the disk and rename it afterward, but the client side is more complicated that it seems
@CodingWithDawid
@CodingWithDawid 2 жыл бұрын
what useEffect do you mean exactly? I mainly use state/useEffect so the app re-renders and shows the progress. i guess that a loop would for fine as well, but you would just need to update state to inform the app about the progress
@chawza8402
@chawza8402 2 жыл бұрын
@@CodingWithDawid thats make sense. Maybe when I watch the video I got confused by many states (states that track files). Thanks for the video. I have implement the similar code as your but fetching inside the loop and it works well.
@sundeeepu
@sundeeepu Жыл бұрын
@@chawza8402 Could you please share the github link of that code you have done with loops. Sir!
@uuach731
@uuach731 3 жыл бұрын
Does anyone know what theme is similar to this in VScode?
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
The name of the theme is "One Dark Pro Italic Vivid" so maybe this one will work: marketplace.visualstudio.com/items?itemName=jsjlewis96.one-dark-pro-italic-vivid
@crazyshala4571
@crazyshala4571 2 жыл бұрын
Really good content man really appreciate can you make a video on streaming video from node to react site
@CodingWithDawid
@CodingWithDawid 2 жыл бұрын
Really interesting idea! I will look into it. Thanks!
@devindissanayaka8116
@devindissanayaka8116 3 жыл бұрын
Im lookimg for a way to download big files from url as chunks and upload them to google drive in heroku like mirror telegram bots. can you make a tutorial how to do that please 🙂
@phamngocson8366
@phamngocson8366 3 жыл бұрын
I have this problem, I upload about 50 files and one file is 3.5 MB. But when I uploaded all of file, Chrome is crash. Can you help me solve this issue?
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
Are all other files also around 3.5MB in size? Do you get any error in you browser console?
@phamngocson8366
@phamngocson8366 3 жыл бұрын
@@CodingWithDawid Yes. when I uploaded new data , chrome memory did not clear and memory grow. I want clear memory chrome when I upload new data.
@mohamedyoussef8835
@mohamedyoussef8835 Жыл бұрын
Awesome video ++++++++++++++ 🙂
@CodingWithDawid
@CodingWithDawid Жыл бұрын
thank you!
@log-o2d
@log-o2d 3 жыл бұрын
can i get source code? i have got some error when i upload files
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
Here: github.com/dejwid/mern-chunked-upload
@log-o2d
@log-o2d 3 жыл бұрын
@@CodingWithDawid thank you
@haiderjaafer8164
@haiderjaafer8164 3 жыл бұрын
Great work keep going forward… is it working on pdf files
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
Thank you! Yes it should work with all file types
@haiderjaafer8164
@haiderjaafer8164 3 жыл бұрын
@@CodingWithDawid How to save files into MySQL and browse that file and show it
@guruswamihiremath2743
@guruswamihiremath2743 3 жыл бұрын
Thank you
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
Thank YOU for watching! 🙂
@jacekjakubiak7974
@jacekjakubiak7974 3 жыл бұрын
You write quite fast, and it is really enjoyable to watch you, but you could separate http logic and make it cleaner.
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
Thanks! You mean to split the backend functionality into smaller chunks?
@paltan_team
@paltan_team Жыл бұрын
yes@@CodingWithDawid
@赵阳-m1v
@赵阳-m1v 3 жыл бұрын
good ,thank you. but i neet a source code
@CodingWithDawid
@CodingWithDawid 3 жыл бұрын
github.com/dejwid/mern-chunked-upload
@ctnava
@ctnava 2 жыл бұрын
Coding with Davie504
File Uploads in React (Complete Tutorial)
25:31
Cosden Solutions
Рет қаралды 16 М.
Build a Todo App with React.js | Beginner React Project using hooks
1:02:25
Coding With Dawid
Рет қаралды 27 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
How to build a REST API with Node js & Express
58:40
Programming with Mosh
Рет қаралды 1,8 МЛН
React File Upload Tutorial with Drag-n-Drop and ProgressBar
59:06
Bruno Antunes
Рет қаралды 58 М.
Pomodoro Timer with React.js
48:43
Coding With Dawid
Рет қаралды 39 М.
Download Progress Bar in React with Fetch API
19:38
Colby Fayock
Рет қаралды 13 М.
Learn Git - The Full Course
4:20:00
Boot dev
Рет қаралды 124 М.
Solving a practical intermediate react interview challenge
13:28
Web Dev Cody
Рет қаралды 100 М.