This REST API allows clients to upload, read (download), update (replace), delete, and administer files on a server. Each file has four unique endpoints (URLs) generated at upload time, corresponding to the different operations.
Check this link to test the API with a user client: https://file.leosdisciple.com/manager/
POST /upload.phpmultipart/form-data).read_urlupdate_urldelete_urladmin_urlGET /read.php?id=READ_IDread_id.POST /update.php?id=UPDATE_IDDELETE /delete.php?id=DELETE_IDGET /admin.php?id=ADMIN_IDadmin_id to recover or rediscover the file’s four unique endpoints.POSTmultipart/form-data containing the file under a key named file.{
"success": true,
"read_url": "https://file.leosdisciple.com/api/read.php?id=...",
"update_url": "https://file.leosdisciple.com/api/update.php?id=...",
"delete_url": "https://file.leosdisciple.com/api/delete.php?id=...",
"admin_url": "https://file.leosdisciple.com/api/admin.php?id=..."
}
GEThttps://file.leosdisciple.com/api/read.php?id=READ_IDPOSThttps://file.leosdisciple.com/api/update.php?id=UPDATE_IDmultipart/form-data containing the new file.{
"success": true,
"message": "File updated successfully."
}
DELETEhttps://file.leosdisciple.com/api/delete.php?id=DELETE_ID{
"success": true,
"message": "File deleted successfully."
}
GEThttps://file.leosdisciple.com/api/admin.php?id=ADMIN_ID{
"success": true,
"read_url": "https://file.leosdisciple.com/api/read.php?id=...",
"update_url": "https://file.leosdisciple.com/api/update.php?id=...",
"delete_url": "https://file.leosdisciple.com/api/delete.php?id=...",
"admin_url": "https://file.leosdisciple.com/api/admin.php?id=..."
}
admin_id.uploads/) with a unique name.files) stores the relationships between the generated IDs and the file path.PHP.ini settings (post_max_size, upload_max_filesize) and custom checks in the code.POST for updates and DELETE for deletions.GET read_url.POST update_url with a new file.DELETE delete_url.admin_id, it can retrieve the 4 links again by calling GET admin_url.This API offers a straightforward mechanism to manage files via unique URLs for each operation. By separating file operations into distinct endpoints (read, update, delete, admin), the API ensures that each link is specialized and only reveals the intended functionality (e.g., read, update, or delete) to whoever possesses the correct URL/ID. This design is flexible for integrating into front-end applications, single-page apps, or even third-party services needing file hosting and management.