Uploading Files to Vultr CDN Push Zones enables you to directly transfer and store your content within the CDN infrastructure. Once your files are uploaded, they are distributed and cached across multiple edge servers within the Push Zones. This ensures that your content is delivered quickly and reliably to users from various locations worldwide. By utilizing this feature, you enhance the efficiency and performance of your content delivery, providing a better user experience through reduced load times and consistent availability.
Follow this guide to upload files to Vultr CDN Push Zones on your Vultr account using the Vultr Customer Portal, API, or CLI.
Send a GET
request to the List CDN Push Zones endpoint and note the target Push Zone subscription's ID.
$ curl "https://api.vultr.com/v2/cdns/push-zones" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a POST
request to the Create CDN Push Zone File Upload endpoint to generate an upload endpoint for the target CDN Push Zone subscription.
$ curl "https://api.vultr.com/v2/cdns/push-zones/{pushzone-id}/files" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"name": "{filename.ext}",
"size": {file_size_bytes}
}'
Send a POST
request to the upload endpoint URL returned in the API response. Pass all inputs as form-data fields with the exact same keys and values. Additionally, add a field named file
, which contains the file to be uploaded. This will successfully upload the file to the target CDN Push Zone subscription.
$ curl "{upload_endpoint_URL}" \
-X POST \
-F "acl=public-read" \
-F "key={CDN_file_path}" \
-F "X-Amz-Credential={X_Amz_Credential}" \
-F "X-Amz-Algorithm={X_Amz_Algorithm}" \
-F "X-Amz-Date={X_Amz_Date}" \
-F "Policy={policy_string}" \
-F "X-Amz-Signature={X_Amz_Signature}" \
-F "file={filename.ext}"
Send a GET
request to the List CDN Push Zone Files endpoint to list all available files in the target Push Zone subscription.
$ curl "https://api.vultr.com/v2/cdns/push-zones/{pushzone-id}/files" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a DELETE
request to the Delete CDN Push Zone File endpoint to delete a file from the target Push Zone subscription.
$ curl "https://api.vultr.com/v2/cdns/push-zones/{pushzone-id}/files/{filename.ext}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
List all available CDN Push Zone subscriptions and note the target Push Zone subscription's ID.
$ vultr-cli cdn push list
Create a CDN Push Zone upload endpoint.
$ vultr-cli cdn push create-endpoint <pushzone-id> --name "<filename.ext>" --size <file_size_bytes>
cURL
or another appropriate method.
List all available files in the target Push Zone subscription.
$ vultr-cli cdn push list-files <pushzone-id>
Delete a file from the target Push Zone subscription.
$ vultr-cli cdn push delete-file <pushzone-id> <filename.ext>
No comments yet.