Documentation

Upload a File

Local files can be uploaded to MageCDN using cURL @ operator.

curl -X POST https://api.magecdn.com/upload \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@/path/to/image.jpg" \
  -F "path=/upload" \
  -F "name=rename_to.jpeg"

Upload from stdin

Sometimes we simply want to upload stdin contents. This is easily achievable using cURL as well.

curl -X POST https://api.magecdn.com/upload \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -F "file=@-" \
  -F "path=/upload" \
  -F "name=rename_to.jpeg"