Updated on 2025-08-14 GMT+08:00

Downloading a File

Function

Download files from the storage.

URI

GET Huawei Cloud Astro Zero domain name/u-route/baas/sys/v1.1/connectors/{connector_type}/{connector_name}/viewobject?object=X&x-image-process=Y

Table 1 URI parameters

Parameter

Mandatory

Type

Description

connector_type

Yes

String

Explanation

Type of a connector.

Constraints

None

Value

  • obs: connector for interconnecting with OBS.
  • minio: connector for connecting to MINIO.
  • objectstorageproxy: object storage proxy type.

Default value

None

connector_name

Yes

String

Explanation

Name of the connector instance, that is, the connector instance name set when the connector is created.

Constraints

None

Value

None

Default value

None

object

Yes

String

Explanation

Full path of the file in the bucket, including the file name.

Constraints

None

Value

None

Default value

None

x-image-process

No

String

Explanation

Defined in OBS to indicate the image processing service.

Example:

  • Command: x-image-process=image/commands
  • Style: x-image-process=style/stylename

Constraints

None

Value

None

Default value

None

Request Parameters

Table 2 Request header parameters

Header Field

Mandatory

Type

Description

Range

No

String

Explanation

Specifies the range of file content to be viewed in the format bytes=numA-numB, where numA is the start byte position and numB is the end byte position.

For example, if the value is bytes=0-, the file content of all bytes is returned.

Constraints

The values of numA and numB must be greater than 0, and numB must be greater than numA.

Value

None

Default value

If this parameter is not specified, all file content is returned.

Response Parameters

Only the file content is returned.

Example Request

An OBS connector has been created. The connector instance name is Namespace __TestOBS. The 1.txt file exists in the a/b/c directory of the OBS bucket. Run the following request to download the 1.txt file:

GET https://Huawei Cloud Astro Zero domain name/u-route/baas/sys/v1.1/connectors/obs/Namespace __TestOBS/viewobject?object=a/b/c/1.txt

Example Response

The following file content is returned:

test

Status Code

See Status Codes.

Error Code

See Error Codes.