URL Encoding

Docroots pointing to object storage are written as URIs, in which the variable components such as access IDs, passwords and secret keys, bucket names, and paths to folders must be URL encoded. For example, when setting a docroot for AWS S3 with the following format:

s3://access_id:secret_key@s3.amazonaws.com/my_bucket

The values for access_id, secret_key, my_bucket, and my_path must be URL encoded while preserving the separators (: and /).

URL Encoding Characters

The following reserved characters are often included in passwords and secret keys:

Character ! # $ & ' ( ) * +
URL encoded %21 %23 %24 %26 %27 %28 %29 %2A %2B
Character . / : ; = ? @ [ ]
URL encoded %2C %2F %3A %3B %3D %3F %40 %5B %5D

To URL encode other characters and to encode entire strings at once, you may use the online tool:

http://www.url-encode-decode.com/

Select UTF-8 as the target.

Examples

AWS S3 docroot with the following inputs:

  • access_id = abc+d
  • secret_key = ef/gh
  • my_bucket/my_path = unicode文件夹/movies

The encoded URI is:

s3://abc%2Bd:ef%2Fgh@s3.amazonaws.com/unicode%E6%96%87%E4%BB%B6%E5%A4%B9%2Fmovies
Note: The forward slash between the bucket name and path is also encoded.

If the docroot also contains queries, for example if the following aspera.conf settings are specified as part of the docroot:

  • storage-class=REDUCED_REDUNDANCY
  • server-side-encryption=AES256

The "&" between the two settings must be encoded as &amp because the URI is in an XML file, as follows:

s3://abc%2Bd:ef%2Fgh@s3.amazonaws.com/unicode%E6%96%87%E4%BB%B6%E5%A4%B9%2Fmovies?storage-class=REDUCED_REDUNDANCY&server-side-encryption=AES256