Transfer large files to an ECS instance, even without a public IP, by using OSS as an intermediary.
Overview
Two main steps:
-
Upload the file to an OSS bucket in the same region as the ECS instance.
-
Download the file from OSS to the ECS instance over the internal network.
Billing
-
Storing files in OSS incurs storage fees.
-
Uploading files to OSS incurs no data transfer fees.
-
Downloading files from OSS to an ECS instance in the same region over the internal network incurs no data transfer fees.
-
Uploading or downloading files incurs request fees.
See Billable items for OSS billing details.
Step 1: Upload the file to OSS
Upload the file to an OSS bucket in the same region as the ECS instance. You can use ossbrowser on your local computer.
Transferring files of 10 GB or more with ossbrowser over a public network may fail. Use Multipart upload instead.
-
Install and log on to ossbrowser.
-
Create a bucket.
-
Click Create Bucket and configure the following parameters. Use the default values for other parameters.
-
Bucket Name: Enter a bucket name.
-
Region: Select Specific Region, then select the region of your ECS instance. See View instance information.
NoteThe region cannot be changed after creation. Products in the same region can communicate over the internal network.
-
-
Click Create.
-
-
Upload the file to the bucket.
-
Click the bucket you created.
-
Click Upload and upload your file.
-
-
Get the file's download URL.
-
Find the uploaded file. In the Actions column, click .
-
Click Generate, then click Copy URL.
-
Step 2: Download the file from OSS
Log on to your instance and download the file from OSS over the internal network.
-
Convert the download URL to an internal network URL.
The copied URL is a public network URL. Add
-internalbefore.aliyuncs.comto convert it to an internal network URL. This avoids data transfer fees for instances in the same region.NoteExample:
https://****.oss-cn-hangzhou.aliyuncs.com/demo-1.0.jar?******becomeshttps://****.oss-cn-hangzhou-internal.aliyuncs.com/demo-1.0.jar?******. -
Download the file to the instance over the internal network.
Windows instance
-
Connect to the Windows instance. See Connect to a Windows instance by using Workbench.
-
Open a web browser on the instance and enter the internal network URL to download the file.
You can also use ossbrowser or ossutil on your Windows instance. See Simple download.
Linux instance
-
Connect to the Linux instance. See Log on to a Linux instance using Workbench.
-
Download the file. This example uses
wget:wget -O <filename> '<file_internal_url>'Replace
<filename>with the target filename and<file_internal_url>with the internal network URL. For example, to downloadhttps://****.oss-cn-hangzhou-internal.aliyuncs.com/demo-1.0.jar?******and save it asdemo.jar:wget -O demo.jar 'https://****.oss-cn-hangzhou-internal.aliyuncs.com/demo-1.0.jar?******'
-
(Optional) Step 3: Clean up resources
To avoid storage fees, delete the file from the OSS bucket after downloading it.