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;
  viewableByGuests?: boolean;
}): Promise<any>;

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.viewableByGuests?booleanAllow users with guest access to the project to view this file

Returns

Promise<any>