Package Files & Folder Uploads
A deployment package carries the files its steps use: an MSI, a setup.exe, a script, or a
whole installation source such as an Office folder with thousands of files in subfolders. This page
covers uploading single files and whole folders in the package editor, by drag-and-drop,
with Add-AthenaDeploymentPackageFile, and over the REST API. It also covers the
minimum free disk space rule that replaces the old per-file size limit, and the rules
for file paths inside a package. For the steps themselves, see
Deployment Package Steps.
Package uploads have no per-file size limit and no limit on the number of files. Earlier releases capped them at 500 MB per file in the console and 1 GB per file over the API. Each file is streamed straight to the server's disk. The only limit is the server's free disk space: Athena refuses an upload that would leave less than the minimum free disk space (10 GB by default).
Uploading in the package editor#
Open Deployments, click View All Packages
(/deployments/packages), then create or edit a package. Enter the package's
folder name first, because a package can't take files without one. Files are uploaded
from the step that uses them:
| Step type | File field |
|---|---|
| Install Application / Uninstall | Installer File |
| Copy Files | Source File |
Next to the file picker there are two buttons:
- Upload files: choose one or more files. Each file goes to the package root.
- Upload folder: choose a folder. Its contents go to the package root and keep their subfolders.
You can also drag files or a folder onto the file row. A dropped folder is handled the same way as Upload folder.
How a folder is laid out#
The name of the folder you pick or drop is not part of the package. Only what is inside it is
uploaded. For example, uploading a folder named OfficeSource stores its files like this:
| On your computer | In the package |
|---|---|
OfficeSource\setup.exe | setup.exe |
OfficeSource\config.xml | config.xml |
OfficeSource\Office\Data\v64.cab | Office/Data/v64.cab |
So an Install Application step can point at setup.exe, and the installer finds its
Office\Data folder next to it on the endpoint, as it would in the original source folder.
The file pickers list every file by its path in the package.
Progress and results#
- Before the upload starts, Athena checks the free disk space rule against the total size of everything you selected. If the rule fails, nothing is uploaded and an error message gives the numbers.
- Files are uploaded one at a time. A progress bar under the file row shows Uploading 3 of 120: Office/Data/v64.cab (45%). The upload buttons are disabled until the upload finishes.
- The package bundle (
package.zip) is rebuilt once, after the last file. When it is ready you see 120 file(s) uploaded. - If a file fails, you see Upload of <path> failed: <reason> and the upload stops. The files already uploaded stay in the package, and the bundle is rebuilt with them.
- If the files arrive but the bundle can't be rebuilt, you see The files were uploaded but rebuilding package.zip failed. Save the package to try again.
- For a new package, the first upload creates the package on the server so the files have somewhere to go.
Replacing a file#
Uploading a file to a path that already exists in the package replaces it. Paths are
compared without regard to case, because a Windows endpoint would treat Setup.exe and
setup.exe as the same file. To update an installation source, upload the new folder over the
old one. Files that are missing from the new folder are not removed from the package. To
start clean, create a new package, or remove the old files with
DELETE api/deployment-packages/{id}/files/{fileId} (see REST API).
Minimum free disk space#
Every file is stored twice on the server: once as the uploaded file and again inside the package's
package.zip bundle. Athena accepts an upload only when the disk that holds the package
files keeps enough free space afterwards:
free space − (2 × upload size) ≥ minimum free disk space
The rule applies to the package editor, PowerShell and the REST API. When an upload is refused, the message gives the numbers, for example:
Not enough free disk space on the server: 18.4 GB free, this upload needs 9.2 GB (the file and its
copy in package.zip), and at least 10 GB must stay free. An Admin sets the minimum in
Settings > Scheduler > Execution.
Changing the minimum#
Go to Settings → Scheduler → Execution and set Minimum Free Disk Space for
Package Uploads. Changing it requires the settings.manage permission. See
Scheduler Settings.
| Setting | Default | Notes |
|---|---|---|
Minimum Free Disk Space for Package UploadsScheduler:PackageUploadMinFreeDiskSpaceGb |
10 GB | Whole gigabytes. 0 means only the upload and its copy in package.zip
must fit. A negative value is treated as 0. As an environment variable, use
Scheduler__PackageUploadMinFreeDiskSpaceGb. |
This value protects this server's own disk, so Settings Sync never copies it to another server. Every other Scheduler setting is synced as usual. Set it on each server separately.
Rules for file paths#
Package files are unpacked on Windows, Linux and macOS endpoints, so every path in a package must be a valid Windows path, even when the Athena server runs on Linux. Backslashes are turned into forward slashes. Athena refuses an upload whose path:
- is empty or longer than 400 characters;
- starts with
/or\, is a UNC path, contains//or ends with/; - has a
.or..segment; - contains
< > : " | ? *or a control character (this blocks drive letters such asC:and alternate data streams); - has a file or folder name that ends with a dot or a space;
- uses a reserved Windows device name, with or without an extension:
CON,PRN,AUX,NUL,COM0–COM9,LPT0–LPT9(for examplenul.txt); - is
manifest.jsonorpackage.zipat the package root, because the bundle uses those names itself. The same names inside a subfolder are allowed.
The refusal reads:
Invalid package file path: 'C:/Temp/x.msi'. Use a relative path such as Office/Data/file.cab, without '..', a drive, ':' or reserved names.
PowerShell: Add-AthenaDeploymentPackageFile#
The Athena PowerShell module 2.19.0 and later uploads files and whole
folders with Add-AthenaDeploymentPackageFile. Each file is streamed from disk in its own
request, so files larger than 2 GB work. The cmdlet has no client time-out, so a long upload isn't
cut off. package.zip is rebuilt once, after the last file. It requires
packages.manage.
| Parameter | Description |
|---|---|
-PackageId (alias -Id) | The package to upload into. Required. Accepted from the pipeline, so you can pipe in a package from Get-AthenaDeploymentPackage or New-AthenaDeploymentPackage. |
-Path (alias -FullName) | One or more files or folders. Required, and the first positional parameter. Wildcards are resolved. A folder is uploaded recursively: every file keeps its path relative to that folder, and the folder's contents go to the package root. |
-File | Every -Path must be a file. A folder is a terminating error. |
-Folder | Every -Path must be a folder. A file is a terminating error. |
-RelativePath | Store a single file under another path in the package, for example Office/Data/x64.cab. Can't be combined with -Folder, and fails when -Path resolves to more than one file. |
Without -File or -Folder, the cmdlet detects each path's type. The cmdlet
supports -WhatIf and -Confirm, and returns one object per uploaded file:
FileName (its path in the package), FileSize, FileHash (SHA-256),
UploadedBy and UploadedAt.
# Upload an Office source folder: setup.exe, config.xml and Office\Data\... with subfolders
Add-AthenaDeploymentPackageFile -PackageId $pkg.Id -Path 'C:\Sources\OfficeLTSC2024' -Folder
# Upload one file to the package root, piping the package in
Get-AthenaDeploymentPackage -Id $id | Add-AthenaDeploymentPackageFile -Path '.\setup.msi' -File
# Upload one file into a subfolder of the package
Add-AthenaDeploymentPackageFile -PackageId $id -Path '.\x64.cab' -RelativePath 'Office/Data/x64.cab'
# Preview what would be sent
Add-AthenaDeploymentPackageFile -PackageId $id -Path 'C:\Sources\App' -WhatIf
Any server error stops the cmdlet with a terminating error. A free-space refusal (HTTP 507) has the
error ID InsufficientServerDiskSpace, in category LimitsExceeded. Files sent
before the error stay in the package, but package.zip is not rebuilt.
Fix the cause and run the same command again: files at the same paths are replaced. Or rebuild the
bundle now with POST api/deployment-packages/{id}/build.
REST API#
| Endpoint | Permission | Purpose |
|---|---|---|
POST api/deployment-packages/{id}/files | packages.manage | Upload one file (multipart/form-data, file part named file). The body is streamed to disk. |
GET api/deployment-packages/{id}/files | packages.view | List the package's files with their paths, sizes and SHA-256 hashes. |
DELETE api/deployment-packages/{id}/files/{fileId} | packages.manage | Remove a file and rebuild the bundle. |
POST api/deployment-packages/{id}/build | packages.manage | Rebuild package.zip. |
The upload endpoint takes two optional query parameters:
| Parameter | Default | Description |
|---|---|---|
relativePath | the file's name | Where to store the file in the package, for example Office/Data/v64.cab. You can also send it as a relativePath form field placed before the file part. Without it, only the uploaded file's name is used, and the file goes to the package root. |
rebuild | true | Set to false to skip rebuilding package.zip after this file. When uploading many files, send rebuild=false for each one and call POST …/build once at the end, as the console and the PowerShell cmdlet do. |
| Status | Meaning |
|---|---|
200 | The file was stored. The message is File uploaded and package rebuilt, or File uploaded when rebuild=false. data holds the stored file. |
400 | No file part (No file provided), an invalid path, or the package doesn't exist. |
401 / 403 | Not signed in, or missing packages.manage. |
507 | Refused by the minimum free disk space rule. The size is checked before any data is read, using the request's Content-Length. |
If a package runs its steps as a stored credential from the Credential
Vault, changing its files also requires the credentials.use permission.
# Upload one file into a subfolder without rebuilding, then rebuild once
curl -H "Authorization: Bearer $TOKEN" \
-F "file=@v64.cab" \
"https://athena.example.local:8443/api/deployment-packages/$PKG/files?relativePath=Office/Data/v64.cab&rebuild=false"
curl -X POST -H "Authorization: Bearer $TOKEN" \
"https://athena.example.local:8443/api/deployment-packages/$PKG/build"
See API Tokens for a token to use in scripts, and the API Reference for the response envelope.
On the endpoint#
- The agent unpacks
package.zipinto the deployment folder and recreates its subfolders, so a step findsOffice\Data\…where the installer expects it. - Agents refuse any bundle entry that would unpack outside the deployment folder. The Linux and macOS agents always made this check. The Windows agent makes it from version 1.2.163; see Agent Binaries & Updates.
- A large package can take minutes to reach each agent. Starting a deployment returns as soon as the agents have the request, and the file transfer continues in the background. Each agent reports its result as usual in Deployment Tracking.
Troubleshooting#
| Symptom | Cause and fix |
|---|---|
| Not enough free disk space on the server: … / HTTP 507 | The upload would leave less than the minimum free. Free space on the server's data volume (for example, delete old packages), add disk, or lower the minimum in Settings → Scheduler → Execution. Remember that each file needs twice its size. |
| Invalid package file path: … | A file or folder name breaks a path rule, often a name ending in a dot or space, or a reserved name such as nul. Rename it in the source and upload again. |
| The upload buttons do nothing | The package has no folder name yet. Enter one, then upload. |
| The files were uploaded but rebuilding package.zip failed. | The files are on the server but the bundle is out of date. Save the package to try again, or call POST api/deployment-packages/{id}/build. Check the server log for the reason. |
| An old file is still in the package after uploading a new version of the folder | Uploads add and replace files but never remove them. Find the old file's id with GET …/files and remove it with DELETE …/files/{fileId}, which also rebuilds the bundle. |
Add-AthenaDeploymentPackageFile: -RelativePath names ONE file inside the package | -Path resolved to more than one file or to a folder. Use -RelativePath with a single file only. |
Related#
- Deployment Package Steps: the step types that use package files.
- Package Templates: the package editor.
- Deployment Packages (PowerShell).
- Package Library: a separate store for single large installer files shared by download link.
- Scheduler Settings → Execution.