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
| Parameter | Type | Description |
|---|---|---|
options.attachmentId? | number | Set if this is an existing project attachment that is being overwritten |
options.buffer | Uint8Array<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.name | string | Filename for the attachment |
options.viewableByGuests? | boolean | Allow users with guest access to the project to view this file |
Returns
Promise<any>