Hi ππ
Welcome in a new post, today i will to use filestack API to upload files to it.
step 1
To upload file to filestack you need to create account in filestack and install filestack
create account : https://dev.filestack.com/signup/free/
pip install filestack-python
step 2
Create main.py
and .env
to store the API-key
get your API-key from your dashboard
paste the API-key into .env
file
.env file
API_KEY = xxxxxxxxxxxxxxx
main.py
from filestack import Client
import dotenv
import os
dotenv.load_dotenv()
API_KEY = os.getenv('API_KEY')
client = Client(API_KEY)
new_filelink = client.upload(filepath = 'imgs/alone.jpg')
print(new_filelink.url)
result
https://cdn.filestackcontent.com/WbkCe47QqSsr5rghkygY
Now we're done π€
Don't forget to like and follow π
Support me on PayPal π€
https://www.paypal.com/paypalme/amr396
For more information :
https://github.com/filestack/filestack-python