Packets

Create file download URL

Creates a presigned download URL and returns file metadata for client-side HTTP download.

Create file download URL creates a short-lived download URL for a file in the current application. The file bytes are downloaded by client over HTTP using the returned presigned_url.

Request

Create file download URL uses packet type = 7.

{
  "type": 7,
  "id": 8,
  "filename": "client.dll",
  "resume_at": 0
}

Prop

Type

Response

{
  "id": 8,
  "presigned_url": "https://cdn.example.net/...",
  "file_size": 1832456,
  "file_checksum": "2f57f0f6f4f8f7df8f4f395f6efc58f3e0681c6cf8f8a53fd2f1f4d76ab4bc9e",
  "status": 1
}

Prop

Type

Client download flow

Send websocket Create file download URL packet and wait for status.

If status = Ok, send HTTP GET request to presigned_url.

If resume_at > 0, include HTTP header Range: bytes=<resume_at>-.

Validate downloaded bytes against checksum policy in your client library.

Checksum notes

  • file_checksum always represents the full stored file.
  • If download starts from byte 0, client can compare full-file checksum directly.
  • If resumed (resume_at > 0), checksum validation strategy depends on your client implementation.
  • FileChecksumMismatch belongs to client-side download validation and is not returned by this websocket packet.

Create-file-download-url statuses

StatusConstantReturned when
1OkPresigned URL and metadata were created successfully.
3NotAuthorizedSession is not authorized for this operation.
6InternalServerErrorServer failed due to an internal error.
300FileNotFoundRequested file was not found.
303FileInvalidResumeOffsetresume_at is negative or greater than or equal to file size.

Connection-close cases (before/around this usecase)

Create file download URL itself returns regular JSON responses, but session can still be closed by protocol/session guards:

Close codeErrorWhen it happens
4200connection is not initializedRequest was sent before successful Initialize.
4201rate limit hit or rate limited, N seconds leftClient IP hit the websocket rate limit, or is still waiting for the temporary block to expire.
4302invalid request bodyPacket body does not match the required schema for this operation.
4304received unsupported dataClient sent unsupported frame type (request packets must be text JSON).

On this page