Scalable archive REST API to compress and extract files using TAR, ZIP, and GZIP.
Firstly, your file must be uploaded or accessible to Bytescale:
Use the Bytescale Dashboard to upload a file manually.
Use the Upload Widget, Bytescale SDKs or Bytescale API to upload a file programmatically.
Use our external storage options to process external files.
Build an archive processing URL:
Get the raw URL for your file:
https://upcdn.io/W142hJk/raw/example.zip
Replace "raw" with "archive":
https://upcdn.io/W142hJk/archive/example.zip
Add querystring parameters to control the output:
https://upcdn.io/W142hJk/archive/example.zip?m=extract
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
Use the Archive Processing API to compress and extract files on demand.
Archive Processing API requests have a 55-second timeout. This means the internal download and compression/extraction operations required to perform your request must complete within this time. This timeout is sufficient for most requests, however, when compressing multiple files using multiple file parameters, we recommend limiting each request to no more than 200 input files with a combined size of less than 2GB to avoid timeouts.
Archive Processing API URLs have a 1000-character limit. To exceed this limit, use a POST request and specify your transformation parameters via the extendedParams parameter in the request body instead of via the querystring.
The total size of the file archive and its uncompressed contents cannot exceed 10GB.
Archives the file.
Response is the archived file, in the format specified by the out parameter.
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.
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.
Note: compression works best with uncompressed content, such as raw images, uncompressed videos, and text, as these files typically contain repeated characters and bytes that compression algorithms are good at reducing. Image formats like JPGs, PNGs and WebP are by design already compressed, so ZIP and other lossless compression algorithms won't be effective at reducing the size of these files any further. This means you'll get similar file sizes when setting c=0 vs. setting c=9 when archiving files such as JPGs.
Use the in and out parameters to specify the file archive format:
Input file will be treated as a .tar archive when using m=extract.
Input file will be treated as a .tar.gz archive when using m=extract.
Input file will be treated as a .zip archive when using m=extract.
Output file will be saved as a .tar archive when using m=archive.
Output file will be saved as a .tar.gz archive when using m=archive.
Output file will be saved as a .zip archive when using m=archive.
Generates a JSON index file to list the archive's contents when using m=extract.
Generates a text index file to list the archive's contents when using m=extract.
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.
The destination path to save the primary file to in the resulting file archive.
Must include a "/" prefix.
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.
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
This website uses cookies. By continuing you are consenting to the use of cookies per our Cookie Policy. Our legal policies were last updated August 16 2024.
This website requires a modern web browser -- the latest versions of these browsers are supported: