Overview
Replace https://yoursite.com below with your actual domain/subdomain on x10Hosting.
Files are stored as a LONGBLOB column in MySQL, along with filename, size, SHA-256 hash, and upload timestamp.
Endpoints
POST/upload.php
Upload a file. Two supported formats:
1. multipart/form-data — field name must be file
curl -X POST https://yoursite.com/upload.php -F "file=@mylib.dll"
2. Raw binary — set Content-Type: application/octet-stream, pass filename as a query param
curl -X POST "https://yoursite.com/upload.php?filename=mylib.dll" \
-H "Content-Type: application/octet-stream" --data-binary @mylib.dll
Response 201:
{
"id": 1,
"filename": "mylib.dll",
"size_bytes": 48640,
"sha256": "c3ab8ff1..."
}
GET/list.php
List metadata for all stored files (no bytes returned).
curl https://yoursite.com/list.php
GET/download.php?id=1
Download the raw bytes of a stored file.
curl -OJ "https://yoursite.com/download.php?id=1"
GET/meta.php?id=1
Metadata only for a single file (no bytes).
curl "https://yoursite.com/meta.php?id=1"
POST/delete.php?id=1
Delete a stored file by id. (POST used instead of DELETE for broad shared-hosting compatibility.)
curl -X POST "https://yoursite.com/delete.php?id=1"
Setup on x10Hosting
- In cPanel, go to MySQL Databases, create a database and a user, and add the user to the database with all privileges.
- Open phpMyAdmin, select your new database, and run
schema.sqlunder the SQL tab. - Edit
config.phpand fill inDB_NAME,DB_USER,DB_PASSwith the values from step 1 (x10Hosting usually prefixes them with your account username, e.g.user_dllstore). - Upload all the
.phpfiles (and thisdocs.html) topublic_html(or a subfolder) via the File Manager or FTP. - Visit your domain to confirm the docs page loads, then test
upload.php.
Limits & notes
Shared hosting caps upload size via
php.ini — typically upload_max_filesize and post_max_size (often 8-32MB by default on free plans). If uploads fail silently for larger files, check these values in cPanel's "Select PHP Version" / "MultiPHP INI Editor" tool.