In my last post, I will explain how we can upload data to Digital Ocean Space now in this post I can show you how we can upload a private file and read that private file in PHP.

Digital Ocean Space If you read my last post you will find I am using CakePHP 3 framework for my example. But if you don’t want to use any framework and want to use Digital Ocean Space in core PHP project you just need composer and plugin which I used last time and you ready to start working with Space. Follow below simple steps to do it. Step 1. I hope you already have a composer in your development environment if not then you can install it using below command or from there official website. Step 2. Now once composer is installed successfully then we need to add a plugin to upload and read files from Digital Ocean Space. Step 3. Now we can add this plugin in PHP file where we need. In below code, we can upload the file as a private file to Space. With the help of the above code, we can upload a private file to Digital Ocean Space. Step 4. Now we successfully upload the private file now we need to read uploaded file. To read a private file in digital ocean space run below code. If everything works fine you will get temporary Url like shown below:- Hope this above code helps you understand digital ocean space private file read and write operation. Please like and share this post. Happy coding 🙂