<< Back to GForge REST API

Entity: Filesystem

GET

getFilesystem

Downloads a file from the filesystem. Streams binary file content directly to the response.

Parameters (2)

Name Type Description
id int Filesystem object id. Required.
option string Set to open to request inline display in the browser instead of download. Optional.

Return: void

Sends binary file data directly to the response.

getThumbnail

Returns a thumbnail image for a file. Rules:

  1. If an existing thumbnail exists, it is returned.
  2. For image files (PNG, JPG, BMP, etc.), a scaled-down version of the original is created.
  3. For PDF documents, a screenshot of the first page is created and then scaled.
  4. For Open-Office-compatible files, a temporary PDF is created and processed as above.
  5. For all other file types, a generic icon for the file type is used.
The thumbnail is saved and returned by subsequent calls for the same ID.

Parameters (1)

Name Type Description
id int Filesystem object id. Required.

Return: void

Sends binary image data directly to the response.

POST

postChunk

Uploads a single chunk of a multi-part file upload.

Parameters (5)

Name Type Description
section string Section the file belongs to (e.g. trackeritem). Required.
refId int Id of the related object. Required.
chunkSeq int 1-based sequence number of this chunk. Required.
id string Upload session hash returned by the first chunk call. Required for chunks after the first.
size int Total expected file size in bytes. Optional; validated against the configured upload limit.

Return: string[]

Associative array with key id containing the upload session hash.

postFilename

Renames a filesystem object and moves the physical file to match the new name.

Parameters (2)

Name Type Description
id int Filesystem object id. Required.
fileName string New file name (minimum 3 characters). Required.

Return: array

Associative array with key location containing the updated URL of the filesystem object.

postFilesystem

Creates or updates filesystem metadata for an uploaded file, returning the URL of the resulting record.

Parameters (4)

Name Type Description
section string Section the file belongs to (e.g. trackeritem). Required.
refId int Id of the related object. Required.
fileName string File name. Required for new records.
id int Filesystem object id. When provided, updates the existing record.

Return: array

Associative array with key location containing the URL of the filesystem object.

PUT

DELETE