Last update at :2024-05-09,Edit by888u
With the gradual decline of free online disks, the living have also begun to attach various conditions that are unacceptable to us, such as price increases, speed limits, etc. This has caused many friends to give up the free network disks on the market and instead buy a VPS with a large hard disk and build their own network disk for their own use. But no matter what, the network disk built by yourself is either expensive, or not secure enough, and it is easy to lose data.
The old foreign network disks are not very easy to use, so we don’t use them much. However, there is a OneDrive program in mainland China. It requires a PHP environment and can mount the OneDrive network disk via API. This allows the data to be displayed and managed intuitively, as well as to preview videos and pictures, without taking up the storage space and traffic of the server. Directly use all OneDrive space and traffic, which is cheaper and much safer than building our own network disk.
Requirements:
1. PHP space, PHP 5.6+ opens curl support
2. Onedrive business account (enterprise or education version/work or school account)
3. oneindex program, download address: https://github.com/donwa/oneindex
After downloading, throw it directly into our website directory, give it read and write permissions, and then visit your website
The following are all optional. With these, you can better manage and use them. If not, it will not affect you
Planned tasks
Recommended configuration, not required. Regularly refresh the cache in the background to increase the speed of foreground access.
# Refresh token every hour
0 * * * * php/program specific path/one.php token:refresh
# Refresh the cache in the background every ten minutes
*/10 * * * * php/program specific path/one.php cache:refresh
Command line function (If it is built on vps, you can run the following commands in SSH for management)
Can only be run in php cli mode and in your website directory
clear cache:
php one.php cache:clear
Refresh cache:
php one.php cache:refresh
Refresh token:
php one.php token:refresh
upload files:
php one.php upload:file local file [onedrive file]
Upload folder:
php one.php upload:folder local folder [onedrive folder]
For example:
//Upload demo.zip to the onedrive root directory
php one.php upload:file demo.zip
//Upload demo.zip to onedrive /test/ directory
php one.php upload:file demo.zip /test/
//Upload demo.zip to the onedrive /test/ directory and name it d.zip
php one.php upload:file demo.zip /test/d.zip
//Upload up/ to onedrive /test/
php one.php upload:file up/ /test/
Recommended site search: webmaster ip, Hong Kong vps host rental, free ip, http proxy ip, domain name free registration 0 yuan registration, domain name registration, registered domain name, registration query Ministry of Industry and Information Technology, free proxy server, Website domain name registration information query,
发表评论