And this video, I'll show you how to share files with others.
What do I mean by that?
Well, we will write a script which uploads a file to a web server and then generates a public link
to that file.
So Python will do the uploading and it will create a link as a string.
Now, of course, we need to use a third party service, a third party cloud service or word to upload
the file.
But the good news is we will use a free service and that is called file stack.
So for this to work, you need to go to file stack, dot com and van.
Go to my apps and then down here, create a new app, you want to go to the free app, and once you
create, it's you will get this app IQ, which we'll show in here.
So you want to copy that and have it already in Python invaluable API key as a string along, we need
to.
Use the Fullstack Library for Python, which is the API library of Python to interact with the full
stack cloud service.
So from files that we want to import client clients is a class which we need to essentially ease here.
So client.
And it expects the API keys argument.
Then what we want to do is create a new link which is equal to client, not upload.
And here you want to specify the name of the arguments equal to some of this, with points to the name
to the file path of the file we want to upload.
For that, I'm going to create a new file here, such as 5.60, so I'm going to upload this text file
to file stack.
Just some simple contents inside the file.
And we were ready to provide the path to that file in here.
So file path is to file the T60 file.
The text is in the same directory with mean, that's why.
So all we have to provide here is the name of the file.
And finally, we want to print out NewLink Link Dots you URL.
So the URL property will give us the public URL for this file.
With that, we're ready to run the code file stack will be installed because it is a third party, the
library.
So if you were running this locally, you need to install Fullstack first.
And then zero, so full stack can be installed using PIP Install, full stack Dash Python.
So let's look at the URL.
If you click Vet's URL, it will take you to the file that was uploaded and that's the contents of the
file.
Since this is a text file in, my browser automatically displays it, but you can save the page as a
text file if you like.
So my file is now uploaded in the cloud, and we use fire stack as a free service to be able to do this.
So if you were using another cloud service, you need to go through the API documentation of the file
service you're using.
And the chances are that there will also be Python tutorials on how to upload files to that cloud service.
So this was how to upload files on file sec.
Thank you.