How to Upload Files and Get Public URLs with One API Call
If you've ever needed to upload a file and get a public URL for a webhook, automation workflow, or just sharing. You know the pain of setting up S3 buckets, IAM policies, and CDN distributions. I b...

Source: DEV Community
If you've ever needed to upload a file and get a public URL for a webhook, automation workflow, or just sharing. You know the pain of setting up S3 buckets, IAM policies, and CDN distributions. I built FilePost to make this a one liner. Upload a file curl -X POST https://filepost.dev/v1/upload \ -H "X-API-Key: fh_your_key" \ -F "[email protected]" Get a CDN URL { "url": "https://cdn.filepost.dev/file/filepost/uploads/a1/a1b2c3.png", "file_id": "a1b2c3d4e5f6", "size": 84210 } That's it. The URL is permanent and served via Cloudflare CDN. It also works with Python and Node.js Python: import requests r = requests.post( "https://filepost.dev/v1/upload", headers={"X-API-Key": "fh_your_key"}, files={"file": open("photo.png", "rb")} ) print(r.json()["url"]) Node.js: const form = new FormData(); form.append('file', fs.createReadStream('photo.png')); const res = await fetch('https://filepost.dev/v1/upload', { method: 'POST', headers: { 'X-API-Key': 'fh_your_key' }, body: form }); console.log((awa