1
00:00:01,819 --> 00:00:06,560
And this video, I'll show you how to share files with others.

2
00:00:06,920 --> 00:00:08,119
What do I mean by that?

3
00:00:08,390 --> 00:00:17,330
Well, we will write a script which uploads a file to a web server and then generates a public link

4
00:00:17,330 --> 00:00:18,170
to that file.

5
00:00:19,130 --> 00:00:23,720
So Python will do the uploading and it will create a link as a string.

6
00:00:24,830 --> 00:00:31,160
Now, of course, we need to use a third party service, a third party cloud service or word to upload

7
00:00:31,160 --> 00:00:31,640
the file.

8
00:00:32,090 --> 00:00:37,400
But the good news is we will use a free service and that is called file stack.

9
00:00:39,270 --> 00:00:43,620
So for this to work, you need to go to file stack, dot com and van.

10
00:00:45,100 --> 00:00:53,800
Go to my apps and then down here, create a new app, you want to go to the free app, and once you

11
00:00:53,800 --> 00:00:57,250
create, it's you will get this app IQ, which we'll show in here.

12
00:00:57,400 --> 00:01:06,940
So you want to copy that and have it already in Python invaluable API key as a string along, we need

13
00:01:06,940 --> 00:01:07,390
to.

14
00:01:09,420 --> 00:01:17,870
Use the Fullstack Library for Python, which is the API library of Python to interact with the full

15
00:01:17,880 --> 00:01:19,710
stack cloud service.

16
00:01:20,190 --> 00:01:28,800
So from files that we want to import client clients is a class which we need to essentially ease here.

17
00:01:29,250 --> 00:01:30,630
So client.

18
00:01:31,650 --> 00:01:34,680
And it expects the API keys argument.

19
00:01:35,790 --> 00:01:43,960
Then what we want to do is create a new link which is equal to client, not upload.

20
00:01:45,630 --> 00:01:55,020
And here you want to specify the name of the arguments equal to some of this, with points to the name

21
00:01:55,020 --> 00:01:58,590
to the file path of the file we want to upload.

22
00:01:59,670 --> 00:02:06,270
For that, I'm going to create a new file here, such as 5.60, so I'm going to upload this text file

23
00:02:06,810 --> 00:02:07,740
to file stack.

24
00:02:14,670 --> 00:02:17,160
Just some simple contents inside the file.

25
00:02:17,700 --> 00:02:21,300
And we were ready to provide the path to that file in here.

26
00:02:22,350 --> 00:02:26,370
So file path is to file the T60 file.

27
00:02:26,370 --> 00:02:29,540
The text is in the same directory with mean, that's why.

28
00:02:29,670 --> 00:02:32,850
So all we have to provide here is the name of the file.

29
00:02:33,360 --> 00:02:39,060
And finally, we want to print out NewLink Link Dots you URL.

30
00:02:39,270 --> 00:02:44,820
So the URL property will give us the public URL for this file.

31
00:02:45,970 --> 00:02:52,450
With that, we're ready to run the code file stack will be installed because it is a third party, the

32
00:02:52,450 --> 00:02:52,960
library.

33
00:02:55,190 --> 00:02:59,300
So if you were running this locally, you need to install Fullstack first.

34
00:03:01,650 --> 00:03:09,750
And then zero, so full stack can be installed using PIP Install, full stack Dash Python.

35
00:03:10,680 --> 00:03:11,820
So let's look at the URL.

36
00:03:12,090 --> 00:03:18,480
If you click Vet's URL, it will take you to the file that was uploaded and that's the contents of the

37
00:03:18,480 --> 00:03:18,810
file.

38
00:03:19,020 --> 00:03:27,330
Since this is a text file in, my browser automatically displays it, but you can save the page as a

39
00:03:27,360 --> 00:03:29,700
text file if you like.

40
00:03:31,980 --> 00:03:40,680
So my file is now uploaded in the cloud, and we use fire stack as a free service to be able to do this.

41
00:03:40,890 --> 00:03:47,490
So if you were using another cloud service, you need to go through the API documentation of the file

42
00:03:47,490 --> 00:03:48,600
service you're using.

43
00:03:48,840 --> 00:03:56,310
And the chances are that there will also be Python tutorials on how to upload files to that cloud service.

44
00:03:56,700 --> 00:03:59,140
So this was how to upload files on file sec.

45
00:03:59,160 --> 00:03:59,550
Thank you.

