WEBVTT

00:03.820 --> 00:05.350
Hated everyone that they share.

00:05.350 --> 00:09.350
And yes, I did created a presentation, a slide for this particular post.

00:09.350 --> 00:11.650
They didn't used it, so I thought, let's use it, this one.

00:11.650 --> 00:16.480
So in this video we're going to see and discuss a little bit more about the files and the images and

00:16.480 --> 00:18.370
how to send it onto the cloud network.

00:18.430 --> 00:21.490
Now, sending to the cloud is not a difficult thing.

00:21.490 --> 00:23.230
It's super easy how to send it.

00:23.230 --> 00:23.860
That might be.

00:23.860 --> 00:27.850
But sending to the cloud only once you have access of the file is super, super easy.

00:27.850 --> 00:30.970
It says, hey, if you'll go on to the cloud API.

00:30.970 --> 00:34.210
And by the way, yes, I did search on the Google Cloud API.

00:34.240 --> 00:35.620
You can see the API reference.

00:35.620 --> 00:41.200
There are so many apps that you can work on with the metadata admin API and a whole bunch of even video

00:41.200 --> 00:41.830
players and all that.

00:41.830 --> 00:43.780
So you can even play the videos and stuff.

00:43.780 --> 00:48.280
Yes, you have to spend a little bit time on understanding it, probably the pricing as well and then

00:48.280 --> 00:49.210
you can go for it.

00:49.210 --> 00:53.590
But the whole part is that cloud native gives you all of this and you can select the Node.js part and

00:53.590 --> 00:57.550
it says, Hey, use the cloud native to upload, upload.

00:57.550 --> 01:00.370
So a lot of methods here, but we can shrink it.

01:00.370 --> 01:05.020
Then you can just pass on the file options and you can even have a callback.

01:05.110 --> 01:08.560
Now we can also set some of the presets and options and all of that.

01:08.560 --> 01:12.880
If you'll dig up a little bit more into the options, you can send in which folder you want to put all

01:12.880 --> 01:17.170
of these files so I can go ahead and go into my cloud dashboard.

01:17.170 --> 01:19.330
I'm pretty sure you might have created an account as well.

01:19.360 --> 01:21.940
Go into the media library, you'll see this as empty.

01:21.970 --> 01:23.650
This is also seems to be a new one.

01:23.650 --> 01:24.640
I'll add a folder.

01:24.640 --> 01:26.710
I'm going to call this one as simply users.

01:26.710 --> 01:27.970
Let's go ahead and save this one.

01:27.970 --> 01:29.980
This is where I'm going to keep all the users.

01:29.980 --> 01:34.720
So whenever I'm sending the file, I'll pass on an option that, hey, upload this one into user.

01:34.720 --> 01:37.480
It's no big deal, just an option and just say folder name.

01:37.480 --> 01:38.170
That's it.

01:38.530 --> 01:41.920
Okay, bigger question is that this is what all we need.

01:41.920 --> 01:45.280
So we have already installed the cloud and we want to use this syntax.

01:45.280 --> 01:47.470
So how this is going to work, it's really, really simple.

01:47.470 --> 01:48.550
Let me show you that.

01:48.850 --> 01:53.650
I will come back onto the index, say that package dot JSON cloud that is already installed.

01:53.650 --> 01:54.370
That's awesome.

01:54.370 --> 01:58.910
So let's go back up here into this one and I will say that I want to use a cloud native.

01:58.930 --> 02:02.350
You can go ahead and let's go ahead and use a const or whatever you like.

02:02.620 --> 02:07.660
So I'm going to go ahead and say Cloud Neri Hey, I'll go ahead and say I need you.

02:07.660 --> 02:10.660
So I'll say just the required and the cloud.

02:10.660 --> 02:10.870
Ready.

02:10.870 --> 02:15.640
Now what you're going to notice that they have actually recently migrated into the version two of their

02:15.640 --> 02:16.210
API.

02:16.210 --> 02:22.000
So they will ask you that hey, always use this dot V to here and then after you can use this upload

02:22.000 --> 02:26.380
or upload or upload or dot assigned, upload, unsigned, upload, whatever you want to use.

02:26.380 --> 02:32.380
So what we can do is we can actually run this method right up here that V to now whenever you are going

02:32.380 --> 02:36.550
to have this cloud entry, it actually means, hey, the cloud v two.

02:36.550 --> 02:37.990
So automatically that comes in.

02:37.990 --> 02:39.190
So I love that part.

02:39.400 --> 02:41.200
Okay, I'm going to go ahead and save this one.

02:41.200 --> 02:44.770
Now comes up to the part where we actually go ahead and use this post.

02:44.830 --> 02:49.000
Now we saw that we are receiving this file into request files.

02:49.000 --> 02:53.530
So I know that I have this file and I know the name of this file as well.

02:54.250 --> 02:59.680
So instead of sending this entirety of the data now, I'm going to go ahead and send the data as details.

02:59.680 --> 03:01.420
So I'm going to go ahead and create an object.

03:01.420 --> 03:03.130
Let's call this one as details.

03:03.160 --> 03:07.570
In this, I'll just say first, first name.

03:07.570 --> 03:13.630
So as soon as this first name comes up, that will be collected by request, dot, body, body, dot,

03:13.630 --> 03:14.830
first name.

03:14.830 --> 03:16.480
So that's how this will be collected.

03:16.480 --> 03:22.450
I also know that there is a last name coming in, last name, and that will be collected by request,

03:22.450 --> 03:25.000
body dot, last name.

03:25.840 --> 03:31.060
Now if you want to send any other detail that we'll worry about later on, but this is what I want to

03:31.060 --> 03:32.320
send as a response.

03:32.320 --> 03:33.550
So this is better.

03:34.750 --> 03:38.110
Now, coming up onto this part where we are having this request file.

03:38.110 --> 03:40.030
So let's go ahead and keep that request.

03:40.030 --> 03:41.890
Console.log is really important in this case.

03:41.890 --> 03:46.270
If you really want to understand this, I'm let's just keep the request body as well.

03:46.270 --> 03:48.160
But I'm not much interested in that part.

03:48.160 --> 03:53.350
I'm going to go ahead and say I want to have a file that I want to send to Cloud Native, how I'm going

03:53.350 --> 03:56.560
to request, how I'm going to access this file.

03:56.560 --> 04:00.850
So I'm going to say request files, then whatever the file name you call it in the front end.

04:00.850 --> 04:07.210
So in this case, we call it a sample file in case you forgot that postman or the post form, remember

04:07.210 --> 04:09.070
this is called as name as sample file.

04:09.070 --> 04:10.810
This is exactly what I'm naming up here.

04:10.810 --> 04:11.650
Sample file.

04:11.950 --> 04:13.660
Okay, so that's what you got.

04:13.780 --> 04:19.810
Now what happens is as soon as you upload this file onto cloud net, some result is giving back to you.

04:19.810 --> 04:23.410
That's the exact keyword they use in the documentation and that's why I'm using it.

04:23.410 --> 04:26.770
So it's easier for you to explore the doc, but feel free to call it Superman.

04:27.130 --> 04:31.630
And then what happens is this entirety of the thing is going to be going like this.

04:31.630 --> 04:32.760
So first we access the cloud.

04:33.100 --> 04:35.890
Remember, it will bring up automatically cloud dot v two.

04:35.920 --> 04:40.480
Then it has the function of uploader and inside that we have so many of these things that we can use

04:40.480 --> 04:42.910
like destroy, explode.

04:42.910 --> 04:44.440
There's so much going on.

04:44.440 --> 04:47.050
What we are interested in is this the simple upload.

04:47.050 --> 04:49.420
So I'm going to go ahead and say, Hey, I just want to upload.

04:49.630 --> 04:55.570
Now we just saw in the documentation that it takes a couple of things you can give a file and the options.

04:55.600 --> 04:56.770
Okay, that's nice.

04:56.770 --> 04:58.360
So I have access.

04:58.840 --> 05:00.790
I have got this access of the file.

05:00.790 --> 05:01.610
So that is really, really.

05:01.800 --> 05:02.760
The easy part.

05:03.060 --> 05:07.590
So I'm going to go ahead and say I will give you this file, so you should be all happy.

05:07.620 --> 05:10.060
And now I go back and provide the options.

05:10.080 --> 05:11.400
Now, how do I provide the option?

05:11.400 --> 05:12.150
It's pretty easy.

05:12.150 --> 05:15.990
I'm going to go ahead and say the folder name, which is going to be users.

05:16.950 --> 05:17.200
Okay.

05:17.310 --> 05:18.720
So so far, so good.

05:18.720 --> 05:20.520
All should be happy now.

05:21.150 --> 05:24.360
Okay, let's go ahead and see a whole lot of errors.

05:24.360 --> 05:26.340
And I want to see the console log as well.

05:26.340 --> 05:29.370
So I'm going to go ahead and say, hey, whatever is there in the result.

05:29.370 --> 05:34.290
First you show me up here and then let's also get it back up here as well.

05:34.290 --> 05:36.930
So we're going to go ahead and say, hey, whatever the result is.

05:36.930 --> 05:38.970
So let's go ahead and grab the result as well.

05:39.930 --> 05:41.100
Okay, looks good.

05:41.100 --> 05:45.270
Let's go ahead and try to send some data to cloud three and let's fail.

05:45.930 --> 05:47.070
Let's go back up here.

05:47.070 --> 05:48.300
This is all reloaded.

05:48.300 --> 05:51.660
Coming back onto this part localhost.

05:51.690 --> 05:53.700
Go back up here, hit a reload.

05:54.120 --> 05:57.900
Let's go ahead and use the test all the way in the first name and the last name test with a couple of

05:57.900 --> 06:02.190
extra TS no bothering there and let's go ahead and fail it for the first time.

06:02.190 --> 06:04.320
I'm going to go ahead and take these options.

06:04.410 --> 06:08.340
And in fact, we are not going to fail yet because I missed one thing.

06:08.340 --> 06:09.060
We want to fail.

06:09.060 --> 06:09.780
We want to fail.

06:09.780 --> 06:10.500
Definitely.

06:10.800 --> 06:15.570
If I go ahead and show you the important thing that I wanted to show you is to remove all of this.

06:15.570 --> 06:17.460
So go ahead and remove all of this.

06:17.460 --> 06:21.930
That's where we want to fail and that's where we want to learn and that's where we want to see the importance

06:21.930 --> 06:22.470
of this.

06:22.470 --> 06:23.730
So please excuse me.

06:23.730 --> 06:27.780
The flow was a little bit off, but go ahead and remove all the options in the file upload.

06:27.780 --> 06:30.630
Let's pass on the empty parenthesis or even remove that.

06:30.660 --> 06:33.720
Go back up here and hit a reload here as well.

06:33.720 --> 06:35.040
Let's go ahead and try this again.

06:35.040 --> 06:40.530
Test, test again a couple of TS and let's use the file and definitely this time let's fail.

06:40.560 --> 06:42.900
Go select this one and say submit.

06:43.020 --> 06:46.350
Now as soon as I submit, it says, Hey, you must apply the API keys.

06:46.710 --> 06:50.130
So obviously I need to supply the API keys and path and all of that.

06:50.130 --> 06:52.410
Let's go ahead and figure out that one.

06:52.740 --> 06:57.630
Now, in order to use the cloud, very obviously, how the cloud is going to know that you have you

06:57.630 --> 06:58.950
are the owner of this one.

06:58.950 --> 07:03.420
So your API keys acts as a keyword, as a password and the user name for you.

07:03.420 --> 07:04.740
So you need to pass on that.

07:04.740 --> 07:09.150
So we're going to go ahead and say, hey, cloud config again, not magically knowing it.

07:09.150 --> 07:12.810
This is this actually comes up from the cloud itself.

07:12.810 --> 07:18.120
Now how it works, first you have to say the cloud name and usually your cloud name comes up in the

07:18.600 --> 07:29.310
from the process dot e and V come on process dot E and V, dot cloud and name something like this if

07:29.310 --> 07:30.360
I can write that.

07:30.660 --> 07:31.440
There we go.

07:31.440 --> 07:33.150
So this is how it usually comes in.

07:33.150 --> 07:35.940
But since we are not using the DOT and V, we are in the learning phase.

07:35.940 --> 07:37.380
We are not going into production yet.

07:37.380 --> 07:39.540
So this is why I'm going to comment this out.

07:39.810 --> 07:42.270
So I'm going to go ahead and below this.

07:42.270 --> 07:44.340
I'm going to go ahead and provide the cloud name.

07:44.610 --> 07:44.830
Okay.

07:44.940 --> 07:46.830
First, let me just collect all of this.

07:47.010 --> 07:55.230
So cloud name from where I can collect you cloud E and going to the dashboard and looks like they are

07:55.230 --> 07:56.340
providing me all up here.

07:56.340 --> 07:57.450
So that's nice of them.

07:57.450 --> 07:58.110
So there we go.

07:58.140 --> 08:00.060
Yes, they actually gives you so cloud name.

08:00.060 --> 08:04.170
I've come up here and again I'm going to go ahead and wrap them up into the string in the process.

08:04.170 --> 08:04.680
Dot Envy.

08:04.680 --> 08:06.330
You don't need to rub them up in the string.

08:06.810 --> 08:07.950
The two more things.

08:07.950 --> 08:14.010
The first one is API underscore key and this is how you pass it.

08:14.010 --> 08:18.600
Just below that you go ahead and say API secret and there you go, you pass it like that.

08:18.600 --> 08:21.030
So these are the two information that you need to send up.

08:21.030 --> 08:23.460
Again, you go ahead and grab that copy to clipboard.

08:23.490 --> 08:29.610
So nicely implemented there, paste that and we're going to go ahead and copy this to Clipboard as well.

08:29.610 --> 08:30.630
Really big one.

08:31.530 --> 08:32.970
This is my environment variable.

08:33.020 --> 08:33.330
Yep.

08:33.390 --> 08:37.920
Apes secret is about once a copy that under the clipboard almost had made a mistake.

08:38.100 --> 08:38.670
There we go.

08:38.670 --> 08:42.900
And definitely I'm going to go ahead and destroy these keys as soon as this video is done.

08:42.900 --> 08:44.070
So go ahead and do that.

08:44.100 --> 08:47.610
This section is done, by the way, are we ready to fail again?

08:47.610 --> 08:48.630
Yes, probably so.

08:48.630 --> 08:49.770
Let's go back up here.

08:50.460 --> 08:50.760
Okay.

08:50.790 --> 08:52.590
So let's go on to this guy.

08:52.590 --> 08:52.980
Yep.

08:52.980 --> 08:53.640
There we go.

08:53.640 --> 08:58.020
Back, hit, reload and hopefully let's go ahead and see the response.

08:58.020 --> 09:00.540
So test, test with a couple of TS.

09:00.540 --> 09:02.430
Choose the file one more time.

09:02.640 --> 09:05.880
Go lang and open that up here and submit that.

09:05.910 --> 09:12.090
Now notice here this says hey, the path argument must be a file type string received an instance of

09:12.090 --> 09:13.940
an object at new node error.

09:13.950 --> 09:15.210
So what is happening here?

09:15.210 --> 09:20.310
We saw that just up here that we are actually receiving in the console log.

09:20.310 --> 09:21.750
We saw that the file is coming in.

09:21.750 --> 09:22.800
But this is not happy.

09:22.800 --> 09:24.690
You're not you need to send the path off.

09:24.690 --> 09:25.830
Must be a type string.

09:25.830 --> 09:30.630
So obviously we got the problem immediately that the problem is that we are sending him the file.

09:30.630 --> 09:35.460
It is giving us just the file name up here because those temporary objects were not present.

09:35.460 --> 09:37.350
So we need to provide it a little bit more.

09:37.350 --> 09:43.650
So can I send it data dot this name or can I directly send this data actually to just see that if it

09:43.650 --> 09:46.020
works or not, just to have some fun.

09:46.020 --> 09:50.460
So let's go ahead and say that this file is actually the entirety of the object.

09:50.460 --> 09:52.410
So this is what we are calling this as a file.

09:52.410 --> 09:55.910
So sample file, we are storing this object into this entirely.

09:55.920 --> 09:57.390
I hope you understand that much better.

09:57.480 --> 10:02.190
So if I go ahead and say file name, it will access this file, the data will access this and all of

10:02.190 --> 10:03.180
these information.

10:03.300 --> 10:07.440
So just to prove my point, I'm going to go ahead and say, instead of saying this file, let's go ahead

10:07.440 --> 10:11.760
and send the data, because some of you might be believing that that buffer data is actually the data

10:11.760 --> 10:12.150
itself.

10:12.150 --> 10:13.710
So why not just give it a try?

10:13.950 --> 10:15.270
Let's go ahead and save this.

10:15.630 --> 10:16.950
That's working fine.

10:16.950 --> 10:17.400
Come on.

10:17.400 --> 10:18.690
Too much of scrolling.

10:18.690 --> 10:25.200
So go ahead and save this one and go back up here, here to reload one more time to see if this thing

10:25.200 --> 10:26.880
is going nice and easy.

10:26.910 --> 10:31.500
Test test with a couple of ts choosing the classic go like image again up here.

10:31.500 --> 10:37.470
By the way, I do have a go length series, check it out and submit that and notice it says again the

10:37.470 --> 10:43.320
same error that hey, this is not am expecting and this is where the big thing comes in.

10:43.320 --> 10:46.980
You need to provide the data URL and again, what is the data?

10:46.980 --> 10:49.470
You are URL data, you are actually consistent.

10:49.470 --> 10:52.680
All of this information that is in fact a file itself.

10:52.680 --> 10:54.960
And that's why I told you it is difficult.

10:54.960 --> 10:57.510
It is difficult to handle the files and all of that.

10:57.510 --> 11:01.200
Now coming to the rescue is going to be the guy that I talked about.

11:01.200 --> 11:05.580
So remember, once we have this one file uploader, where are you?

11:05.580 --> 11:07.320
There we go at line 18.

11:07.320 --> 11:09.750
This is where we need to provide all these options.

11:09.750 --> 11:12.360
Since my clipboard is all gone, I have to use this one.

11:12.360 --> 11:13.260
So temporary files.

11:13.260 --> 11:14.610
Yes, I want to use this one.

11:14.610 --> 11:18.990
So I'll pass on a flag of true and where this temporary file is going to be stored.

11:18.990 --> 11:21.990
Again, the best part, what I like about this temporary directory.

11:21.990 --> 11:27.060
This directory is created at the time you are uploading the file and once the file is gone or that request

11:27.060 --> 11:32.910
is all gone, it immediately removes that also so beautifully designed like hats off to the developer.

11:33.000 --> 11:34.710
So this is going to be the temp.

11:34.710 --> 11:36.630
And just like that, that's it.

11:36.630 --> 11:39.330
You can actually reuse this exact code whenever you like.

11:39.330 --> 11:44.130
Now once you have this, then you can actually go ahead and say, Hey, I don't want to send you this

11:44.130 --> 11:45.900
file and data and all of that.

11:45.900 --> 11:48.360
This can be changed a little bit.

11:48.660 --> 11:49.260
A little bit.

11:49.260 --> 11:51.870
But first, we need to see what is coming in.

11:51.870 --> 11:53.760
We'll still keep it as file or data.

11:53.760 --> 11:55.470
We'll see another one more error.

11:55.470 --> 11:58.200
And that hopefully will help us to understand a bit more.

11:58.200 --> 12:01.950
Save this one and coming back this time again.

12:02.220 --> 12:04.020
Expecting one more error this time.

12:04.020 --> 12:10.140
So test test with a couple of t choose that and go image upload that.

12:10.140 --> 12:13.410
I will not stop till I upload this co image onto the cloud.

12:13.530 --> 12:16.890
Re Now coming back onto this reading the errors.

12:17.220 --> 12:22.080
Now notice here this time the data is coming in, it is having the same buffer and name, but this time

12:22.080 --> 12:24.780
it is coming with the temp file path.

12:24.780 --> 12:30.540
So I do have now a path which is slash, temp slash the unique ID being given to this.

12:30.540 --> 12:32.700
And this is exactly the file that I need.

12:32.700 --> 12:38.130
The file is now moved from the front end into a temporary zone and I can access that zone via the back

12:38.130 --> 12:38.430
end.

12:38.430 --> 12:39.660
So beautiful.

12:39.660 --> 12:45.510
So I can all have to do is say whatever you are calling your file dot the temp file path.

12:45.510 --> 12:46.980
So I'm going to go ahead and copy this.

12:46.980 --> 12:48.480
So beautifully designed.

12:48.480 --> 12:49.650
I'm super impressed.

12:50.040 --> 12:50.220
Okay.

12:50.310 --> 12:52.620
We can go ahead and remove this one instead of the data.

12:52.620 --> 12:55.680
This time I need to send the temp file path and that's it.

12:55.680 --> 12:57.600
That's all we need that.

12:57.720 --> 12:59.790
Let's go ahead and save this one.

12:59.790 --> 13:06.720
And hopefully, hopefully this time we'll be able to send our go image onto the Cloud Network again,

13:06.720 --> 13:08.310
make sure the folder is there.

13:08.310 --> 13:09.960
Otherwise it sometimes gives you error.

13:09.960 --> 13:12.150
It doesn't automatically create a new folder for you.

13:12.150 --> 13:17.460
So go ahead and verify that coming back and hit the reload and let's try it one more time.

13:17.460 --> 13:23.460
We're going to go ahead and say test, this is test and let's choose a file again, the classic go image

13:23.460 --> 13:29.730
and we're going to go ahead and hit submit and notice it says, hey, the result is empty this time

13:30.300 --> 13:30.570
now.

13:30.570 --> 13:30.780
Yes.

13:30.850 --> 13:35.020
Obviously the result is empty and you will understand the reason for that in a minute.

13:35.590 --> 13:40.630
But to your surprise or not, to your surprise, let's go up into the cloud and see what has happened

13:40.630 --> 13:41.920
into the media library.

13:41.950 --> 13:43.840
I can see that there is new user.

13:43.840 --> 13:48.290
If I go ahead and check it out, let's go ahead and see browse into this.

13:48.340 --> 13:48.820
Okay.

13:48.820 --> 13:52.330
So finally I was able to push my go into the cloud.

13:53.170 --> 13:54.070
Okay, that is fine.

13:54.070 --> 13:58.990
That is nice that we have actually successfully hit that, but we were not able to see any result that

13:58.990 --> 13:59.720
is going on.

13:59.740 --> 14:04.510
This is because it happened so fast that it is not really good thing.

14:04.750 --> 14:06.790
We need to actually wait for a few minutes now.

14:06.790 --> 14:11.680
Notice it returns me a promise and we didn't give any time to actually get this promise back.

14:11.710 --> 14:16.300
In fact, one of the major things that you are going to see in all of the production level code is your

14:16.300 --> 14:21.190
entirety of the function is wrapped around to have some kind of a big promise, because entirety of

14:21.190 --> 14:25.270
the world is of the JavaScript as these days running onto the promise, and sometimes you don't need

14:25.270 --> 14:26.650
that much of the promises.

14:26.890 --> 14:30.460
So how we're going to do that, we are going to wait for this result.

14:30.460 --> 14:32.530
So for that, we're going to use the keyword.

14:32.530 --> 14:36.670
Now, since I'm using the wait keyword, I need to go ahead and move into the async part.

14:36.670 --> 14:37.990
So let's go ahead and do that.

14:38.170 --> 14:43.180
And once you actually do this now, it will wait for this result to come in or you can use the promises

14:43.180 --> 14:43.520
as well.

14:43.540 --> 14:47.950
Cloud and upload and all of that and say, hey dot then dot catch again.

14:47.950 --> 14:48.760
Classic JavaScript.

14:48.760 --> 14:52.420
Nothing no bad up here again both of these methods are same.

14:52.420 --> 14:56.440
If you are using dot then and dot cache are using a single weight, it's kind of a same.

14:56.440 --> 15:00.370
But this time since I've already uploaded the go length time to choose something different.

15:00.370 --> 15:06.190
So let's go ahead, save this one and let's go back up here onto the local host, going back up here,

15:06.190 --> 15:08.710
hitting a reload and choosing a different image.

15:08.710 --> 15:13.990
So again, test a couple of tests like that and let's choose a different image, probably a thumbnail

15:13.990 --> 15:20.920
that I recently created for one of the video like a long time ago, not recently and submit this one

15:20.920 --> 15:22.960
and this time it's waiting there a little bit.

15:22.960 --> 15:27.790
The loading is happening and now we are seeing a ton of data that is coming back to us and this data

15:27.790 --> 15:30.280
is actually nicely formatted on our console.

15:30.280 --> 15:33.040
So we'll be actually doing that part up here.

15:34.000 --> 15:36.850
Let's see first if the image has uploaded or not.

15:36.850 --> 15:37.600
Obviously it has.

15:37.600 --> 15:39.490
So I need to just hit a refresh up here.

15:40.310 --> 15:41.910
And there we go.

15:41.930 --> 15:43.550
Our image is coming in nicely.

15:43.550 --> 15:45.110
So that is part I'm happy.

15:45.110 --> 15:48.710
And I go back up here and I see this is all what we are getting.

15:48.710 --> 15:52.460
So this entirety of this object is the result that is coming up.

15:52.460 --> 15:54.700
So result has so much of the data.

15:54.710 --> 15:57.890
The first thing that I love about is is the public ID.

15:57.920 --> 16:03.170
Now, I have seen some of the places where actually when you upload these files, they actually store

16:03.200 --> 16:04.580
them with the same name itself.

16:04.580 --> 16:05.900
This creates a lot of problems.

16:05.900 --> 16:11.180
Sometimes people just say their name always with one dot PNG or one dot jpeg and having the same name

16:11.180 --> 16:12.620
image means you are going to overwrite.

16:12.650 --> 16:13.580
No good for you.

16:13.580 --> 16:16.010
So you can handle these cases where your own.

16:16.010 --> 16:22.550
Maybe you want to give something a try like nano ID or you id give a unique name to each image and stored

16:22.580 --> 16:25.610
there in case you are using file store or firebase or something.

16:25.700 --> 16:27.070
I love that cloud.

16:27.080 --> 16:28.220
Nobody actually handles that.

16:28.220 --> 16:33.380
So all I need to do is in my database, I can store this public ID and they give you even the path and

16:33.380 --> 16:34.160
the unique name.

16:34.160 --> 16:35.510
So fantastic.

16:35.780 --> 16:38.300
They also gives you a couple of URLs as well.

16:38.300 --> 16:43.700
So if you store the directory URL, you can store that and if you want to, you store the security URL

16:43.700 --> 16:45.830
that is just an HTTP s version of it.

16:45.830 --> 16:48.110
You can go ahead and use that access mode.

16:48.110 --> 16:53.150
We are also allowed to pass in on the action modes or access mode and we can change it from public to

16:53.660 --> 16:54.590
private or something.

16:54.590 --> 16:56.540
And they also gives you the original file name.

16:56.540 --> 16:57.980
Remember the temp that we are using?

16:57.980 --> 16:59.240
So this is what we are having.

16:59.240 --> 17:02.600
It also sends you back an API key, so make sure you are cautious about that.

17:02.600 --> 17:04.370
But again, nobody is giving you the secret.

17:04.370 --> 17:05.690
So this is all fine.

17:05.840 --> 17:07.580
So this is all the basics of it.

17:07.580 --> 17:12.860
And I hope now you understand absolutely in-depth detail about how to handle all of this.

17:13.070 --> 17:14.450
But there is a little bit more.

17:14.480 --> 17:15.800
There is a little bit more.

17:15.800 --> 17:19.280
What about when we have multiple of the files coming in?

17:19.280 --> 17:20.690
We haven't talked about that.

17:20.690 --> 17:24.320
So this is how to upload one file, but told you this is a pro-level course.

17:24.320 --> 17:26.870
So we're going to handle how to handle multiple files as well.

17:26.900 --> 17:29.150
But in the next video, let's catch up there.
