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.

No upload size limit, but a disk-space floor

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 typeFile field
Install Application / UninstallInstaller File
Copy FilesSource File

Next to the file picker there are two buttons:

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 computerIn the package
OfficeSource\setup.exesetup.exe
OfficeSource\config.xmlconfig.xml
OfficeSource\Office\Data\v64.cabOffice/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#

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.

SettingDefaultNotes
Minimum Free Disk Space for Package Uploads
Scheduler: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.
Settings sync leaves it alone

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:

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.

ParameterDescription
-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.
-FileEvery -Path must be a file. A folder is a terminating error.
-FolderEvery -Path must be a folder. A file is a terminating error.
-RelativePathStore 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
A refused file stops the whole upload

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#

EndpointPermissionPurpose
POST api/deployment-packages/{id}/filespackages.manageUpload one file (multipart/form-data, file part named file). The body is streamed to disk.
GET api/deployment-packages/{id}/filespackages.viewList the package's files with their paths, sizes and SHA-256 hashes.
DELETE api/deployment-packages/{id}/files/{fileId}packages.manageRemove a file and rebuild the bundle.
POST api/deployment-packages/{id}/buildpackages.manageRebuild package.zip.

The upload endpoint takes two optional query parameters:

ParameterDefaultDescription
relativePaththe file's nameWhere 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.
rebuildtrueSet 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.
StatusMeaning
200The file was stored. The message is File uploaded and package rebuilt, or File uploaded when rebuild=false. data holds the stored file.
400No file part (No file provided), an invalid path, or the package doesn't exist.
401 / 403Not signed in, or missing packages.manage.
507Refused 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#

Troubleshooting#

SymptomCause and fix
Not enough free disk space on the server: … / HTTP 507The 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 nothingThe 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 folderUploads 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.