Downloading and Uploading Files
How to download and upload files with Airtop
Downloading Files
Airtop allows your agents to download files from the web. This is useful for a variety of use cases such as downloading a PDF to analyze, or downloading an image to use in a design.
First, you’ll need to perform an action that will trigger a download. For example, you can use the Click
action to click on a button that will trigger a download. Then, you can request that the file being downloaded be written to the local file system.
You can also specify a callback to get progress updates on the download.
Lookback
By default, downloadNextFile
waits for a file to be downloaded, or looks back in time for the previous 5 seconds to see if a file download was triggered. This can be useful if the click
interaction was very fast and triggered a download before the downloadNextFile
call was made. However, you can configure the lookback period to be as long or short as you want, including 0 to disable lookback.
There are other options to further control the download process if you are downloading multiple files, or want to initiate the download process yourself at a later time.
Finer grained control of the download
Most of the time, you can use the downloadNextFile
method to download the next file in the queue. However, if you need more control over the download, you can use other methods.
waitForDownload
returns metadata about the file that allows you to manually download the file. The response includes a downloadUrl
which is a 1 hour, signed URL that can be used to download the file from any HTTP client.
Alternatively, you can always list the files that have been downloaded so far for a single session.
This can be useful if you need to download multiple files from the same session in succession and later want to retrieve them.
Uploading Files
Uploading files is coming soon… stay tuned!