Vana SDK - v0.1.0
    Preparing search index...

    Interface UploadFileParams

    Defines parameters for uploading files to storage providers with encryption options.

    Used with DataController upload methods and storage operations. Supports multiple content formats, optional encryption, and custom storage provider selection with comprehensive metadata tracking.

    Use UploadParams with vana.data.upload() instead for the high-level API

    const uploadParams: UploadFileParams = {
    content: new TextEncoder().encode(JSON.stringify(userData)),
    metadata: {
    name: "personal-profile.json",
    mimeType: "application/json",
    size: 2048,
    },
    storageProvider: "ipfs",
    encrypt: true,
    };

    const result = await vana.data.uploadFile(uploadParams);
    interface UploadFileParams {
        content: string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>;
        metadata?: FileMetadata;
        storageProvider?: string;
        encrypt?: boolean;
        encryptionKey?: string;
    }
    Index

    Properties

    content: string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>

    Raw file data in bytes, buffer, or string format.

    metadata?: FileMetadata

    Descriptive metadata for file organization and tracking.

    storageProvider?: string

    Storage provider name or uses configured default if unspecified.

    encrypt?: boolean

    Enables automatic encryption before upload to storage.

    encryptionKey?: string

    Custom encryption key or generates one automatically if encryption enabled.