How to download an object from an Edge Storage bucket
This guide walks you through downloading an object from an Edge Storage bucket using the Azion API and Azion Runtime.
Downloading an object from a bucket
To download the object, run the following GET
request in your terminal, replacing [TOKEN VALUE]
with your personal token, <bucket_name>
with the name of your bucket, and <object_key>
with the key created for the object:
You should now see the contents of the object in your terminal.
You can create an edge function to download objects from your bucket using a GET
console command. To do so:
- Access Azion Console > Edge Functions.
- Click the + Edge Function button.
- Name your function. Example:
my-bucket GET
. - In the Code tab, add the following JavaScript code, passing your bucket’s name and the object key:
- Click the Save button.
Once you have the edge function ready, you need to create an edge application that will proxy the process for the bucket and instantiate the edge function.
Go to Edge Application first stepsGo to how to instantiate an edge function