Skip to content
On this page

Services

Files

The Files service stores file content, such as documents, exports and snapshots, against File objects held in the Configuration Store.

14 min read Edit this page
Central services
ACS implementationACS Files serviceSee how the AMRC Connectivity Stack implements this.View on GitHub

Files is a Factory+ plugin service that stores the content of files.

Typical files are PDF drawings, CSV exports, CAD models and data snapshots taken by an Edge Agent. Factory+ clients often need to keep a file next to the configuration it belongs to, but the Configuration Store holds JSON documents and is not suited to large or binary content.

Files does not keep a second catalogue of files. Every file is an ordinary object in the Configuration Store. The object gives the file its UUID, its name and its owner. The classes the object belongs to give the file its type. The Files service holds only the bytes. A client finds a file in the same way as any other Factory+ object, and a site grants access to it in the same way too.

Files is a plugin service. A Factory+ deployment does not need it, but a deployment that offers file storage SHOULD offer it through this interface so that clients work unchanged on any implementation. The service follows the service specification. Clients find it in the Directory under the service UUID a2a6efc5-9793-4486-9fd9-7caf9e3b5451.

The file object model

A file has two halves, and each lives in a different service.

  • The File object is a Configuration Store object that is a member of the File class. A client creates it before uploading anything. Its UUID is the file’s UUID everywhere in Factory+.
  • The content is the bytes of the file. The Files service stores them under the File object’s UUID.

After a successful upload, the Files service writes an upload record for the file. The record is kept in the Files configuration application in the Configuration Store, keyed by the file’s UUID. A client learns a file’s original name, size and uploader from the upload record, because a download returns only the bytes.

Classes

The File class and its file types follow the class model of the object model.

flowchart TB
    FG["File group<br/>(rank 2 class)"]
    FT["File type<br/>(rank 2 class)"]
    F["File<br/>(rank 1 class)"]
    PDF["PDF"]
    CSV["CSV"]
    CAD["CAD"]
    TXT["TXT"]
    obj["A file<br/>(individual)"]
    FT -- subclass of --> FG
    F -- member of --> FG
    PDF -- member of --> FT
    CSV -- member of --> FT
    CAD -- member of --> FT
    TXT -- member of --> FT
    PDF -- subclass of --> F
    CSV -- subclass of --> F
    CAD -- subclass of --> F
    TXT -- subclass of --> F
    obj -- member of --> PDF
  • File is a rank 1 class. Every file is a member of it, directly or through a subclass. The Files service refuses content for any UUID that is not a member.
  • File type is a rank 2 class whose members are the kinds of file. Each file type is itself a rank 1 class and a subclass of File, and a file that is a member of a file type is therefore also a member of File.
  • File group is a rank 2 class above File type. File is a member of it, and File type is a subclass of it. File group therefore collects every class of files.

The framework defines four file types: PDF, CSV, CAD and TXT.

An application that stores its own kind of file SHOULD define a class for it, rather than putting its files only in File. The class is a rank 1 class and a subclass of File. It is a member of File type if it is a file format, and a member of File group otherwise. A class of its own lets a site grant permissions on that kind of file without granting them on every file.

The Files service never reads a file’s type. Clients use the type to decide how to open a download. Grants use it to cover a kind of file.

The upload record

The upload record is a JSON object in the Files configuration application 731cb924-71bb-49fa-8cb8-1584bd1ebad3, under the file’s UUID.

FieldTypeMeaning
file_uuidstring (UUID)The UUID of the File object.
date_uploadedstring (date-time)When the upload finished, in ISO 8601 form in UTC, for example 2026-11-30T14:05:12.481Z.
user_who_uploadedstringThe identity the uploader authenticated with. A client that used Kerberos is recorded by its Kerberos principal name. A client that used an OIDC bearer token is recorded by its principal UUID.
file_sizeintegerThe size of the stored content in bytes.
original_file_namestring or nullThe value of the original-filename header on the upload, or null if there was none.
device_uuidstring (UUID) or nullThe value of the device-uuid header on the upload, or null if there was none.

For example:

{
    "file_uuid": "3f0c7a52-5a8e-4d7b-9c3e-1b2a4d6e8f90",
    "date_uploaded": "2026-11-30T14:05:12.481Z",
    "user_who_uploaded": "operator@EXAMPLE.COM",
    "file_size": 482113,
    "original_file_name": "press-7-drawing.pdf",
    "device_uuid": "b9a7f6d2-1c34-4e8a-9f0b-6d5e4c3b2a19"
}

Upload records are written by the Files service. Clients MUST NOT write them, because the service treats a record as proof that the content is complete.

A client reads an upload record from the Configuration Store with GET /v2/app/731cb924-71bb-49fa-8cb8-1584bd1ebad3/object/{file UUID}. The request needs the Configuration Store’s Read config permission on the application. To learn when an upload completes, a client can watch that entry through the Configuration Store’s change-notify interface instead of polling.

If a file has a File object but no upload record, it has no content yet or its content has been deleted.

Uploading a file

A file is uploaded in two steps. The client creates the File object first and then sends the content.

sequenceDiagram
    participant C as Client
    participant CS as Configuration Store
    participant F as Files
    participant A as Auth
    C->>CS: POST /v2/object {"class": PDF file type}
    CS-->>C: 201 {"uuid": file UUID}
    C->>F: PUT /v1/file/{file UUID} (content)
    F->>A: Read the client's ACL
    F->>CS: Is the UUID a member of File?
    F->>F: Store the content
    F->>CS: Write the upload record
    F-->>C: 201 {"uuid": file UUID}
  1. The client creates the File object in the Configuration Store with POST /v2/object, giving the class the file is to have. The class SHOULD be a file type. The request needs the Configuration Store’s Create object permission on that class. If the client chooses the UUID itself, it needs Create specific object instead. The Configuration Store records the client as the object’s owner. Ownership decides which files a grant on Mine covers.
  2. The client MAY give the object a name through the General Information application, and MAY add it to further classes.
  3. The client sends the content to the Files service with PUT /v1/file/{uuid}.
  4. The Files service stores the content, writes the upload record and answers 201.

A content upload looks like this.

PUT /v1/file/3f0c7a52-5a8e-4d7b-9c3e-1b2a4d6e8f90 HTTP/1.1
Host: files.example.com
Authorization: Negotiate YIIC...
Content-Type: application/octet-stream
original-filename: press-7-drawing.pdf
device-uuid: b9a7f6d2-1c34-4e8a-9f0b-6d5e4c3b2a19

<482113 bytes of PDF>
HTTP/1.1 201 Created
Content-Type: application/json

{ "message": "File uploaded successfully.", "uuid": "3f0c7a52-5a8e-4d7b-9c3e-1b2a4d6e8f90" }

Request

The body is the raw file content. A client SHOULD send it with the content type application/octet-stream, whatever kind of file it is. A client MUST NOT send it as application/json. A server is allowed to decode JSON bodies before the handler sees them, which would leave the stored content wrong or empty.

Two optional headers carry information into the upload record.

HeaderMeaning
original-filenameThe name of the file on the client, such as press-7-drawing.pdf. The service stores it as original_file_name and uses it for nothing else.
device-uuidThe UUID of the device the file belongs to, when it belongs to one. It MUST be a member of the Device class 18773d6d-a70d-443a-b29a-3f1583195290 in the Configuration Store. The service stores it as device_uuid.

The service checks that a device-uuid names a device. It does not check that the uploader has any permission on that device. A consumer MUST NOT treat device_uuid as proof that the device or its owner supplied the file.

Content is written once

A file’s content cannot be replaced. A second PUT to a file that has content fails with 409. To change a file, a client creates a new File object and uploads to that. It can instead delete the old content first. Write-once content keeps every file UUID tied to one set of bytes, and a consumer that has recorded a file UUID can rely on getting the same content later.

If two uploads to the same file arrive at once, a server MUST accept at most one of them. A PUT that arrives while another upload to the same file is in progress fails with 503. The client MAY retry once the first upload has finished.

What the service checks

The service checks an upload in this order and stops at the first failure.

CheckStatus on failure
The UUID in the path is a well-formed UUID.410
The caller holds Upload on the file.403
The UUID is a member of the File class in the Configuration Store.404
The device-uuid header, if present, is a well-formed UUID.400
The device-uuid header, if present, names a member of the Device class.404
No other upload to this file is in progress.503
The file has no content yet.409
The body is no larger than the server accepts.413

A server MAY limit the size of an upload, and SHOULD reject a larger body with 413 without storing any of it. A failure to write the content gives 500, and a failure to write the upload record to the Configuration Store gives 503. In every failure case the service stores nothing, and a retry starts clean.

The response to a successful upload is 201 with a JSON body whose uuid is the file’s UUID.

Consistency between content and record

The content and its upload record are written to different places. A server MUST NOT let a client download content before the upload record exists. The recommended order is to write the content to a temporary location, then write the upload record, and only then move the content into place. After a crash, a restarting server SHOULD keep any temporary content whose upload record was written and discard any whose record was not.

Downloading a file

GET /v1/file/3f0c7a52-5a8e-4d7b-9c3e-1b2a4d6e8f90 HTTP/1.1
Host: files.example.com
Authorization: Negotiate YIIC...

The response is the stored content with the content type application/octet-stream. The original file name and a more specific content type are not returned. A client that needs them reads the upload record and the file’s classes from the Configuration Store. A server MAY honour HTTP range requests.

StatusMeaning
200The body is the file content.
401The request was not authenticated, or the credentials were wrong.
403The caller does not hold Download on the file.
404The caller may download the file, but no content is stored for it.
410The UUID in the path is not a well-formed UUID.
503The service could not check the caller’s credentials or permissions.

Because the permission check comes first, a caller without Download receives 403 whether or not the file exists.

Listing files

GET /v1/file returns the stored files as a JSON object.

{ "files": ["3f0c7a52-5a8e-4d7b-9c3e-1b2a4d6e8f90", "8d1e4b7a-2f90-4c6d-b3a5-7e9f0a1c2d34"] }

Each entry is the UUID of a File object whose content is stored. While an upload is in progress, a server MAY also list a temporary entry that is not a UUID. A client SHOULD ignore any entry that is not a UUID.

The request needs List Storage on the Wildcard target. It is meant for administration and housekeeping, such as finding content whose File object has gone. A client that wants the files of one kind or one device SHOULD ask the Configuration Store for the members of the file type, or search the upload records, rather than list the whole store.

Deleting a file

DELETE /v1/file/{uuid} removes the stored content and the file’s upload record, and answers 204. The File object stays in the Configuration Store. The caller can delete it there afterwards with the Configuration Store’s Delete object permission.

A caller deletes the content through Files first and the object second. The order matters for a caller that holds Delete through a class of files. The reason is that a grant on a class covers a file only while the File object is still a member of that class.

StatusMeaning
204The content and the upload record are gone. The service also answers 204 when there was no content, so the request is safe to repeat.
401The request was not authenticated, or the credentials were wrong.
403The caller does not hold Delete on the file.
410The UUID in the path is not a well-formed UUID.
503Either the content was removed but the upload record could not be, or the service could not check the caller’s credentials. Repeating the request finishes the deletion.

A file with no content is not an error, because a File object is created before its upload, and the upload may never have happened. A delete does not stop an upload that is already in progress.

Permissions

Every request is checked against the caller’s grants from the Auth service, following the authorisation model. Four permissions belong to the Files permission group.

PermissionUpload
81ed0b6c-7305-4f51-85c5-5c66bdac7920
Target: a file. Store the content of the file.
PermissionDownload
3b436260-2100-454b-aea5-8f933a1ed7e5
Target: a file. Read the content of the file.
PermissionDelete
82a2206b-b9d8-4eee-bc0e-63fb8785019e
Target: a file. Remove the content of the file and its upload record.
PermissionList Storage
c9dc7146-3f55-4721-8638-0ab8c7834e72
Target: the Wildcard only. List every stored file.
Permission groupFiles permission
09cce2eb-dc82-4a5a-b2ec-bca12f456ab8
The group of all four Files permissions. A grant of the group is a grant of every Files permission.

Targets

For Upload, Download and Delete, the service looks for the file’s own UUID in the caller’s ACL, and also accepts the Wildcard. Auth expands plural grants before the service sees them. A caller holds one of these permissions on a file when any of these is true:

  • It holds a grant whose target is the file itself.
  • It holds a plural grant whose target is a class the file belongs to, such as a file type. For example, a plural grant of Download on the PDF file type lets the caller download every PDF.
  • It holds a plural grant whose target is Mine, and it owns the File object. This is the usual grant for a client that creates its own files, because the Configuration Store makes the creator the owner.
  • It holds a grant whose target is the Wildcard, which is the Null UUID. That grant covers every file.

For List Storage, the service accepts only a grant whose target is the Wildcard itself, because the list covers every file at once.

A grant on a class of files MUST NOT give a caller rights over files outside that class. For this reason the service checks the file’s own UUID rather than only the Wildcard. A principal that may upload one kind of file cannot fill an empty File object of another kind.

A worked example

An Edge Agent stores the snapshots it takes. It creates File objects in its own class of files and chooses each object’s UUID itself. It also uploads to them, reads them back and cleans them up. A site gives the agent’s principal these grants.

PermissionTargetPluralEffect
Create specific object (Configuration Store)the snapshot classnoIt may create File objects in that class with UUIDs it chooses. It owns each one it creates. Create object is not enough when the agent picks the UUID.
UploadMineyesIt may upload to the files it owns.
DownloadMineyesIt may download the files it owns.
DeleteMineyesIt may delete the content of the files it owns.
Delete object (Configuration Store)MineyesIt may then delete the File objects it owns.

Because every grant on Mine covers only the agent’s own files, a second Edge Agent with the same grants cannot read or delete the first agent’s snapshots. A person who reviews the snapshots might instead hold a plural grant of Download on the snapshot class. That grant covers every snapshot, whoever made it.

What the service itself needs

A Files service runs as a Factory+ principal of its own. That principal needs these grants for the checks above.

GrantTargetUsed for
Read ACLsFiles permission groupReading its callers’ Files permissions from Auth.
Read config and Write configFiles configuration applicationWriting and removing upload records.
Read membersFile class and Device classChecking that a file UUID and a device-uuid are what they claim to be.

Service routes

As on every Factory+ service, GET /ping returns the service UUID and the interface version, which is 1.0.0. The ping response is defined in the service specification. POST /token issues a bearer token for this service.

Well-known UUIDs

ServiceFiles
a2a6efc5-9793-4486-9fd9-7caf9e3b5451
The service UUID that the Files service is registered under in the Directory.
ClassFile
b8fae5ab-678e-4d35-802f-2dd8ee3b5b02
Rank 1 class. Every file is a member of it, directly or through a subclass such as a file type.
ClassFile type
923801b3-c97a-48d8-8af9-da97dc13fe2d
Rank 2 class whose members are the kinds of file. Each member is a subclass of File.
ClassFile group
cd5b941e-f952-4cba-9db5-323b1db80d23
Rank 2 class that collects every class of files. File is a member and File type is a subclass.
File typePDF
291aa8d4-b743-46b2-a883-0fa1c94e419a
PDF documents.
File typeCSV
d006b2ab-0df2-4f99-abd9-e15d8c9cd359
Comma-separated values.
File typeCAD
ff7c1a80-7866-48a7-aa2b-c4beb1878a4b
CAD models.
File typeTXT
68a241cc-5ea7-45df-a1c4-87a35079795d
Plain text.
ApplicationFiles configuration
731cb924-71bb-49fa-8cb8-1584bd1ebad3
Holds the upload record of each file, keyed by the file's UUID.

The Files permissions are listed under Permissions. Every framework UUID is also collected in the well-known UUIDs reference.

API reference

OpenAPI specificationView the full OpenAPI specification for the Files serviceView specification
get/v1/file
List the stored files

Lists the names of the stored content. Requires the List Storage permission (c9dc7146-3f55-4721-8638-0ab8c7834e72) on the Wildcard target (00000000-0000-0000-0000-000000000000). A grant on any other target does not allow this request.

Each name is the UUID of a File object whose content is stored. While an upload is in progress the list may also hold a name that is not a UUID, which a client should ignore.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Responses
200

The stored files.

application/jsonFileList
  • filesrequiredarray of string
401

The request was not authenticated, or the credentials were wrong.

403

The caller does not hold the permission this request needs.

application/jsonMessage
  • messagestring
503

The service could not check the caller's credentials or permissions, or could not reach the Configuration Store. The client may retry later.

post/v1/fileDeprecated
Withdrawn

Withdrawn. This route always answers 410. A client creates the File object in the Configuration Store and then uploads the content with PUT /v1/file/{uuid}.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Responses
410

The endpoint has been withdrawn.

application/jsonMessage
  • messagestring
get/v1/file/{uuid}
Download a file's content

Returns the stored content of the file. Requires the Download permission (3b436260-2100-454b-aea5-8f933a1ed7e5) on the file, through a grant on the file itself, on a class it belongs to, on Mine for a file the caller owns, or on the Wildcard.

The original file name, size and uploader are not returned here. They are in the file's entry in the Files configuration application in the Configuration Store.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesstring (uuid)

The UUID of the File object.

Responses
200

The file content.

application/octet-streamstring
401

The request was not authenticated, or the credentials were wrong.

403

The caller does not hold the permission this request needs.

application/jsonMessage
  • messagestring
404

The caller may download the file, but no content is stored for it.

application/jsonMessage
  • messagestring
410

The UUID in the path is not a well-formed UUID.

application/jsonMessage
  • messagestring
503

The service could not check the caller's credentials or permissions, or could not reach the Configuration Store. The client may retry later.

put/v1/file/{uuid}
Upload a file's content

Stores the request body as the content of the File object named in the path. The object must already exist in the Configuration Store as a member of the File class (directly or through a subclass such as a file type), and must not already have content, because content is written once and never replaced.

Requires the Upload permission (81ed0b6c-7305-4f51-85c5-5c66bdac7920) on the file, through a grant on the file itself, on a class it belongs to, on Mine for a file the caller owns, or on the Wildcard.

The request body is the raw file content. Send it as application/octet-stream. A body sent as application/json is decoded as JSON instead of being stored.

The service checks the request in this order: the UUID, the Upload permission, that the File object exists, the device-uuid header, then whether content is being uploaded or already stored. It writes the content, then the upload record, and the file can be downloaded only once both have succeeded.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesstring (uuid)

The UUID of the File object.

original-filenameheaderNostring

The name of the file on the client, such as report.pdf. The service records it in the upload record as original_file_name, and does not use it for anything else.

device-uuidheaderNostring (uuid)

The UUID of the device the file belongs to. When it is given it must name a member of the Device class (18773d6d-a70d-443a-b29a-3f1583195290), and the service records it in the upload record as device_uuid.

Request body (required)
application/octet-streamstring
Responses
201

The content was stored and the upload record written.

application/jsonUploadResult
  • messagestring
  • uuidrequiredstring (uuid)

    The UUID of the File object the content was stored for.

400

The device-uuid header is not a well-formed UUID.

application/jsonMessage
  • messagestring
401

The request was not authenticated, or the credentials were wrong.

403

The caller does not hold the permission this request needs.

application/jsonMessage
  • messagestring
404

No File object with this UUID exists in the Configuration Store, or the device-uuid header names an object that is not a member of the Device class.

application/jsonMessage
  • messagestring
409

Content is already stored for this file. Content cannot be replaced.

application/jsonMessage
  • messagestring
410

The UUID in the path is not a well-formed UUID.

application/jsonMessage
  • messagestring
413

The body is larger than the service accepts. Nothing is stored.

application/jsonMessage
  • messagestring
500

The service could not write the content. Nothing is stored.

503

Another upload to this file is in progress, or the service could not write the upload record to the Configuration Store, or could not check the caller's credentials. Nothing is stored, and the client may retry later.

delete/v1/file/{uuid}
Delete a file's content

Removes the stored content and the file's upload record. The File object stays in the Configuration Store, and the caller deletes it there afterwards if it wants to.

Requires the Delete permission (82a2206b-b9d8-4eee-bc0e-63fb8785019e) on the file, through a grant on the file itself, on a class it belongs to, on Mine for a file the caller owns, or on the Wildcard. A grant on a class only covers the file while the File object exists, so a caller deletes the content before the object.

A file with no content is not an error, so the request answers 204 whether or not content was stored and can be repeated safely. An upload already in progress is not stopped.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesstring (uuid)

The UUID of the File object.

Responses
204

The content and the upload record are gone, or never existed.

401

The request was not authenticated, or the credentials were wrong.

403

The caller does not hold the permission this request needs.

application/jsonMessage
  • messagestring
410

The UUID in the path is not a well-formed UUID.

application/jsonMessage
  • messagestring
500

The service could not remove the content.

503

The content was removed but the upload record could not be removed from the Configuration Store, or the service could not check the caller's credentials. Repeating the request finishes the job.

get/ping
Identify the service
Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Responses
200

The service identity.

application/jsonPing
  • versionrequiredstring

    The version of this interface specification.

  • servicerequired"a2a6efc5-9793-4486-9fd9-7caf9e3b5451"
  • softwareobject

    Optional details of the implementation.

    Fields
    • vendorstring
    • applicationstring
    • revisionstring
401

The request was not authenticated, or the credentials were wrong.

post/token
Issue a bearer token for this service

Returns an opaque bearer token that is valid only on this service, for the principal that authenticated the request.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Responses
200

A new token.

application/jsonToken
  • tokenrequiredstring

    The bearer token.

  • expiryrequiredinteger

    Expiry time in milliseconds since the Unix epoch.

401

The request was not authenticated, or the credentials were wrong.

Esc