Skip to content

gi-nx


gi-nx / uploadProjectAttachment

ts
function uploadProjectAttachment(options: {
  attachmentId?: number;
  buffer: Uint8Array<ArrayBuffer>;
  contentType:   | "image/png"
     | "image/jpeg"
     | "image/webp"
     | "image/*"
     | "model/glb"
     | "model/gltf"
     | "application/json"
     | "application/pdf";
  name: string;
  projectId?: string;
  viewableByGuests?: boolean;
}): Promise<ProjectAttachment>;

Upload a file as a project attachment.

Parameters ​

ParameterTypeDescription
options.attachmentId?numberSet if this is an existing project attachment that is being overwritten
options.bufferUint8Array<ArrayBuffer>File data as Uint8Array
options.contentType| "image/png" | "image/jpeg" | "image/webp" | "image/*" | "model/glb" | "model/gltf" | "application/json" | "application/pdf"MIME type of the file
options.namestringFilename for the attachment
options.projectId?stringProject to upload the attachment to, defaults to the active project
options.viewableByGuests?booleanAllow users with guest access to the project to view this file

Returns ​

Promise<ProjectAttachment>