Minio Cloud storage API for Web/App[Part-3 folders]

SanjayKhanSSK
2 min readMar 15, 2020

Let’s see how to create folders,download file,delete file.

Photo by Artem Sapegin on Unsplash

So if you haven’t follow the previous episodes , must read that shows how to setup Docker for minio , Connecting with python,Uploading Image.

Get Started:

So in this episode we’re going to see Create Read Delete API of Minio ,

I hope you’re connected with minio and bucket created.

1.Creating Folder

#minioClient.fput_object(bucket,location_to_save,local_file_path)
minioClient.fput_object('python', 'folder1/testing.png', '/home/ssk/Pictures/inkscape/laptop2.png',content_type='image/png')
Folder Created

<folder>/<file> You can add any number of folder ex: <folder>/<folder>/<file>

2.Downloading From Minio:

#minioClient.fget_object(bucket_name, file_path_to_download , local_path_to_save)
minioClient.fget_object('python', 'folder1/testing.png', '/home/ssk/Pictures/inkscape/laptop2.png')

3.Deleting Files:

#minioClient.remove_object(bucket_name, file_path)
minioClient.remove_object('python', 'testing.png')
testing.png got deleted

Okay you have learned the basics but this is not enough , feel free to Explore MINIO DOCS , If I’m free I’ll write about Minio Error handling , getting list of Buckets , Setting up policies for buckets , Encrypting bucket etc…

Maybe a flask with Minio Tutorial with CRUD file in the Cloud in future.

--

--