Inputs and sources
Understand accepted file shapes, ZIP entry names, and how Local and Cloud fetch remote URLs.
The files option accepts browser files and remote URLs without requiring you
to normalize them first.
Which input shapes can I use?
| Shape | Example | Use it for |
|---|---|---|
FileList | input.files | A browser file picker |
File or Blob | selectedFile | One browser-owned file |
| URL string | 'https://example.com/report.pdf' | A remote file with an inferred name |
| Source object | { url, filename } or { file, filename } | A custom path inside the ZIP |
Pass one item directly or mix multiple items in an array:
const result = await createZip({
files: [
selectedFile,
'https://cdn.example.com/report.pdf',
{
url: 'https://cdn.example.com/data.csv',
filename: 'exports/data.csv',
},
],
zipName: 'bundle.zip',
});An empty or unsupported input fails before a job starts.
How is the ZIP entry name chosen?
Eazip uses the first available name in this order:
- the explicit
filenameon a source object; - a file's
webkitRelativePath, preserving a selected directory structure; - the file's
name; - the last path segment of a URL;
- a generated
file-Nfallback.
Paths are sanitized so they cannot escape the archive root. Duplicate names
receive (2), (3), and later suffixes before the extension.
Who fetches a remote URL?
| Local | Cloud | |
|---|---|---|
| Fetches the URL | The user's browser | Eazip Cloud |
| CORS required | Yes | No |
| Browser cookies sent | No | Not applicable |
| Accepted sources | Files, blobs, and URLs | URLs only |
For Local jobs, the source must allow an anonymous browser request. A custom
fetch can add headers or route the request through infrastructure you control.
For Cloud jobs, CORS no longer applies, but the source must be reachable by Eazip Cloud and allowed by the Public App configuration. A host that works in a browser can still reject server-side requests.
Next steps
- Create a ZIP from remote URLs.
- Configure Cloud keys and origins.
- Look up the exact
ZipInputcontract.