Skip to main content
Attaching a file to a test case input, a trace input or a trace output? Use test_cases.upload_input_file() / input_file_paths, input_file_paths on traces.create(), or traces.upload_output_file() / output_file_paths, instead: each calls this method for you and returns the reference in the shape it expects. Reach for this method directly to store a file for another purpose, or when you need the raw URI rather than an AttachedFile.

Returns

Returns the URI the file is stored under. It still carries the upload’s signature and expires. Attaching it to a test case input, a trace input or a trace output replaces it with a signature-free storage reference when the entity is written, so what you read back never expires. Never treat the uri you get here as a link to the bytes: it expires. Ask for a fresh one with galtea.storage.download() or galtea.storage.read().

Example

Parameters

string
required
Path to the file on the machine running the SDK.
string
default:"file"
What the file is for, which decides the folder it is stored under and who may read it. The default, "file", is an attachment on a test case input, a trace input or a trace output. The platform also accepts "groundTruth", "testFile", "testCaseExport", "dataCatalog" and "audio".
string
The name the platform records the object under. Defaults to the file’s own name.

Errors

A failed upload raises an error naming the file and the cause. The message never contains the presigned link, which grants write access to that object for 24 hours.