WEBVTT

00:03.880 --> 00:06.490
One of the most difficult thing is video crashing.

00:06.490 --> 00:09.120
I can handle the video crashing and I can rerecord the videos.

00:09.130 --> 00:10.660
No problem at all with the smile.

00:10.660 --> 00:11.740
I can do it again.

00:11.740 --> 00:16.720
But the problem is I have to move back onto the code onto that stage where it was creating a problem

00:16.720 --> 00:18.460
and it spoils the fun some time.

00:18.550 --> 00:21.640
So at this point you might be thinking, Hey, everything is working.

00:21.640 --> 00:25.060
Spoiler alert, it's not going to work, so let's go ahead and try this out.

00:25.060 --> 00:26.710
So we just went up here.

00:26.710 --> 00:29.770
We go ahead and say, Hey, this is going to be test this one.

00:29.770 --> 00:33.700
Let's go ahead and say another test and let's choose a file as well.

00:33.700 --> 00:39.250
I'm going to go ahead and say hey again, let's classic go pag and just submit this one.

00:39.250 --> 00:43.510
It says, hey, I'm taking the first name, I'm taking the last name, I'm taking the sample.

00:43.510 --> 00:44.890
So it looks good this time.

00:44.890 --> 00:49.960
And we did talked a lot about these middle layers and all of that temporary directories and options,

00:49.960 --> 00:51.760
but still it gives us this undefined.

00:51.760 --> 00:53.650
So what is going on wrong with that?

00:53.680 --> 00:57.190
Now, this is exactly where the things come in for the front end developer.

00:57.220 --> 01:01.660
The reason why I'm showing you this, because it is necessary for us and probably I'll create a dedicated,

01:01.660 --> 01:05.050
separate front end course where I talk about this much of detail.

01:05.050 --> 01:07.510
Probably next year somehow I'll do that.

01:07.510 --> 01:08.950
Let's go back and see that.

01:08.950 --> 01:10.210
How we can fix this one.

01:10.210 --> 01:12.640
Now, this is a classic issue on the front end part.

01:12.640 --> 01:17.140
It is not your fault you are handling this absolutely nicely with this video option.

01:17.140 --> 01:20.410
There's a file upload, file options and all of this post option.

01:20.410 --> 01:22.840
This is all it is required from your side.

01:22.960 --> 01:24.460
Now let's go back up here.

01:24.460 --> 01:29.470
Now, the problem is actually this form is not yet ready to accept these images.

01:29.470 --> 01:31.150
Now, images are not like text.

01:31.180 --> 01:35.830
Yes, these express and all that helps us to convert that into just request or body.

01:35.830 --> 01:37.510
But this form is of different type.

01:37.510 --> 01:42.040
It needs to mention that this is encryption type in majority of the time when we work in the front end,

01:42.040 --> 01:43.300
we don't take care about that.

01:43.300 --> 01:50.770
This is the by default option which says application slash x w w w form URL code n and this is exactly

01:50.770 --> 01:53.680
what you see up here into the postman as well.

01:53.680 --> 01:59.560
This is kind of a front end thing, but since this is not a form which is URL encoded, this is a different

01:59.560 --> 02:00.640
type of category.

02:00.640 --> 02:03.940
This is let me go ahead and see if it suggests me something.

02:03.940 --> 02:06.010
No, let me go ahead and write that again.

02:06.130 --> 02:07.270
Come on, escape.

02:08.100 --> 02:09.330
Let me try to write that.

02:09.330 --> 02:12.480
So whenever you're going to write this one notice here we have a couple of things.

02:12.480 --> 02:15.090
This one is multipart form data.

02:15.090 --> 02:16.170
Yes, that's it.

02:16.170 --> 02:17.670
Told you it is a front end thing.

02:17.670 --> 02:19.050
It is not in your fault.

02:19.080 --> 02:23.280
Let me go ahead and show you a couple of more things that are really, really interesting up here.

02:23.280 --> 02:24.030
I go ahead.

02:24.030 --> 02:27.150
Save this one, hit my server, save so that it reloads.

02:27.150 --> 02:28.290
Go back up here.

02:28.470 --> 02:31.500
Go back here and hit a reload here so that everything resets.

02:31.500 --> 02:33.240
Now, go ahead and let's try it here.

02:33.240 --> 02:38.250
So I'm going to go ahead and say hit dash and another test and let's choose a file this time.

02:38.250 --> 02:40.770
This file knows that I need to carry some data.

02:40.770 --> 02:44.280
So notice how behave how it is going to behave so differently.

02:44.280 --> 02:49.200
When I go ahead and hit submit, it says, Hey, this is all I need to carry first name and last name.

02:49.200 --> 02:54.060
Because notice this time we have explicitly mentioned that you'll be carrying data, you'll be carrying

02:54.060 --> 02:55.350
the files as well.

02:55.350 --> 02:59.520
When I go back on to this one here and voila, this time say this one.

03:00.060 --> 03:03.900
We have received some of the data and we have received the file as well.

03:03.900 --> 03:05.340
So everything is done.

03:05.340 --> 03:09.690
So again, there are a couple of ways you can ask your frontend developer to send a data URL that is

03:09.690 --> 03:14.250
all good, or you can just go ahead and do and take care of everything onto your back end part.

03:14.250 --> 03:17.040
But there is a little bit more there is a little bit more to it.

03:17.070 --> 03:18.990
Now notice here how the data is coming in.

03:18.990 --> 03:23.220
Data says, it says, hey, this is a buffer data and the sizes and all of that.

03:23.310 --> 03:28.410
But what if I told you something different that what we have seen so far, this file upload and you

03:28.410 --> 03:30.570
might be thinking this is doing all the magic.

03:30.570 --> 03:32.520
No, this is not doing all the magic.

03:32.520 --> 03:33.630
You might be wrong.

03:33.630 --> 03:39.000
The part that we wrote in the form itself that is doing the magic, but this is also required.

03:39.000 --> 03:40.710
Let me show you how it goes.

03:40.710 --> 03:46.740
Now, if you go ahead and cut this out and save this one again, let's try to fill out the form one

03:46.740 --> 03:47.580
more time.

03:47.580 --> 03:50.700
And this might surprise you, might catch you off, guard it as well.

03:51.090 --> 03:52.110
Reload that.

03:52.770 --> 03:56.310
Let's go ahead and say test and go ahead and say another test.

03:56.460 --> 04:04.140
Choose the file again, which is going to be again, you know it classic Gopi and G and select that

04:04.140 --> 04:07.680
and hit submit it goes nicely.

04:07.680 --> 04:12.900
I go back and come back here and I try to compare this and it says, okay, the data is coming in.

04:12.900 --> 04:18.000
The only difference that I'm able to kind of visually see that this time it says data buffer and this

04:18.000 --> 04:19.650
time it just expands the data.

04:19.650 --> 04:24.390
Rest of all, the things are exactly same, and that's why I chose the simple same image up here.

04:24.390 --> 04:27.240
So we just studied that for nothing.

04:27.420 --> 04:28.620
No, not like that.

04:28.620 --> 04:30.210
I need to put that back up again.

04:30.210 --> 04:32.040
So all these options are important.

04:32.070 --> 04:36.990
Now, these options are going to come in handy when you either use this move function, it gives you

04:36.990 --> 04:41.970
a move function in case you want to move the data onto your directory or your your servers, or you

04:41.970 --> 04:45.900
might want to upload them onto some cloud eight of us or something at that time.

04:45.900 --> 04:49.740
These options are going to become life saver, but again, this is all fun.

04:49.740 --> 04:53.850
So let's carry on this video and we are going to talk about uploading files onto the cloud.

04:54.150 --> 04:57.210
But in the next video, let's go ahead and catch up in the next one.
