Knowledge Base
Can I download a zip file directly to my server?
Overview
By the end of this article you will be able to transfer a CodeGuard zip file backup directly to your web server, avoiding the slower route of downloading it locally and uploading it again. The article covers three stages in order: confirming you have Secure Shell (SSH) access, the command-line connection to your server that this method requires; copying the download link from your CodeGuard dashboard or notification email; and running the wget command, a standard tool that retrieves a file from a web address directly onto the server. A verify the transfer section confirms the file arrived intact, and a troubleshooting section covers the most common failure: an expired download link.
Before you begin
You will need:
- SSH access to the server that will receive the file. If you are unsure whether your hosting plan includes SSH access, ask your hosting provider.
- An SSH client to open a session on the server, such as Terminal on macOS or Linux, or PuTTY on Windows.
- The
wgetcommand available on the server. Most Linux hosting environments include it by default. - A completed zip file backup in CodeGuard, and the download link from your dashboard or the notification email.
- Enough free disk space on the server to hold the zip file.
Step 1: Copy the download link
When a zip file backup is ready, CodeGuard provides a download link in two places: the Restore area of your dashboard, and the email notification sent when the zip file was created. Copy the full link from either location.
The link is a signed web address that includes an expiry value. It stops working after a limited period, so copy it shortly before you run the transfer rather than saving it for later use.
Step 2: Transfer the file with wget
- Open an SSH session to your server.
- Change to the directory where you want the zip file to be saved.
- Run the following command, replacing the example address with the link you copied:
wget -O backup.zip "https://cg-zips.s3.amazonaws.com/backup.zip?AWSAccessKeyId=AAAGF&Expires=98765&Signature=AjxuqO"
The -O backup.zip portion sets the name the file is saved under. Change backup.zip if you prefer a different filename.
Enclose the address in quotation marks. The link contains ampersand characters (&). Without quotation marks, the command line treats each ampersand as a command separator and splits your single command into three, which fails.
Step 3: Verify the transfer
The transfer succeeded when all of the following are true:
wgetreports the download as saved, with no error.- The file appears in the directory when you list its contents, and its size is greater than zero.
- The archive opens without error. You can confirm this by listing its contents with
unzip -l backup.zip.
Troubleshooting
The download link no longer works, or the server returns an access error
The signed link has expired. Return to your CodeGuard dashboard, generate or copy a fresh download link, and run the command again promptly.
The command splits into several commands, or reports an unexpected token
The address was not enclosed in quotation marks. Re-run the command with the full address inside double quotes.
The command is not found
wget is not installed on the server. Ask your hosting provider to install it, or use curl instead:
curl -o backup.zip "<link>"
The transfer stops partway, or the file is smaller than expected
The server may have run out of disk space. Check available space and free up room before retrying.
If the problem persists, contact Sectigo support.
Similar questions
- How do I transfer a CodeGuard backup to my server without downloading it first?
- Can I use wget to retrieve a CodeGuard zip file?
- Why does my CodeGuard download link stop working?
- How do I restore a CodeGuard backup over SSH?
Need assistance?
Contact our team for help with your purchase or issuing your certificate.