File Upload Service
This service accepts one uploaded file and returns a public URL.
Rule
- If you do not send
name, the service creates a new unique URL. - If you send the same
nameagain, the file at that URL is replaced.
Endpoint
POST https://hello-world.dev.myapp.fund/api/files
Content type: multipart/form-data
Fields:
file: required binary filename: optional stable file key
Create New URL
curl -X POST https://hello-world.dev.myapp.fund/api/files \ -F file=@./asset.png
Expected response:
{
"name": "generated-name",
"url": "https://hello-world.dev.myapp.fund/files/generated-name",
"updated": false,
"size": 1234,
"content_type": "image/png",
"original_filename": "asset.png"
}
Update Existing URL
curl -X POST https://hello-world.dev.myapp.fund/api/files \ -F name=landing-logo \ -F file=@./asset.png
Expected response:
{
"name": "landing-logo",
"url": "https://hello-world.dev.myapp.fund/files/landing-logo",
"updated": true,
"size": 1234,
"content_type": "image/png",
"original_filename": "asset.png"
}
Read Metadata
GET https://hello-world.dev.myapp.fund/api/files/<name>
Fetch File
GET https://hello-world.dev.myapp.fund/files/<name>