Data Types

Archive Processing API

Scalable archive REST API to compress and extract files using TAR, ZIP, and GZIP.

1 Upload your file

To process a file, the input file must be uploaded to your account, or accessible via a URL:

Icon

Use the Bytescale Dashboard to upload a file manually.

Icon

Use the Upload Widget, Bytescale SDKs or Bytescale API to upload a file programmatically.

Icon

Create external HTTP folders to process files hosted externally.

Get the input file's /raw/ URL before continuing.

2 Build your archive URL

To build an archive processing URL:

2a

Get the /raw/ URL for your input file.

2b

Replace /raw/ with /archive/.

2c

Add the querystring parameters documented on this page, e.g.:

https://upcdn.io
Account
/W142hJk/
API
archive
File Path
/example.zip
Parameters
?m=extract

3 Download your file(s)

When archiving files, the response will be the archived/compressed file:

https://upcdn.io/W142hJk/archive/example.jpg?m=archive

When extracting files, the response will be a JSON object containing links to each extracted file:

https://upcdn.io/W142hJk/archive/example.zip?m=extract
{
"files": [
{
"size": 12,
"artifact": "/example-file.txt"
},
{
"size": 962594,
"artifact": "/example-image.jpeg"
}
]
}

To download each file, append &artifact=<artifact_path> to the URL:

https://upcdn.io/W142hJk/archive/example.zip?m=extract&artifact=/example-file.txt

API Reference

Use the Archive Processing API to compress and extract files on demand.

The total size of the file archive and its contents must not exceed 10GB.

m=archive

Archives the file.

Response is the archived file, in the format specified by the out parameter.

m=extract

Extracts the file archive.

Response is a text file containing a list of file sizes and relative file paths, which you can download using the artifact query parameter.

c=<int>

Only applicable to m=archive with out=zip or out=tar.gz.

Sets the compression level for the resulting file archive.

0 = lowest compression and largest file size.

9 = highest compression and smallest file size.

Formats

Use the in and out parameters to specify the file archive format:

in=tar

Input file will be treated as a .tar archive when using m=extract.

in=tar.gz

Input file will be treated as a .tar.gz archive when using m=extract.

in=zip

Input file will be treated as a .zip archive when using m=extract.

out=tar

Output file will be saved as a .tar archive when using m=archive.

out=tar.gz

Output file will be saved as a .tar.gz archive when using m=archive.

out=zip

Output file will be saved as a .zip archive when using m=archive.

f=json

Generates a JSON index file to list the archive's contents when using m=extract.

f=text

Generates a text index file to list the archive's contents when using m=extract.

Paths

Only applicable to m=archive:

  • Use dest to specify the location to save the primary file to within the output archive.

  • Use file and file-dest to add additional files to the output archive.

dest=<string>

The destination path to save the primary file to in the resulting file archive.

Must include a "/" prefix.

file=<string>

Additional file to add to the resulting file archive.

You may specify this parameter multiple times.

To use: specify the "file path" attribute of another file as the query parameter's value.

file-dest=<string>

The destination path to save the additional file to in the resulting file archive.

You may specify this parameter multiple times: once per file parameter.

Must include a "/" prefix.

Requires: file

Was this section helpful? Yes No

You are using an outdated browser.

This website requires a modern web browser -- the latest versions of these browsers are supported: