naystack - v1.5.10
    Preparing search index...

    Interface SetupFileUploadOptions

    Options for setting up file upload via setupFileUpload.

    interface SetupFileUploadOptions {
        getKey?: (
            data: { data: object; type: string; userId: number },
        ) => Promise<string>;
        onUpload: (
            data: {
                data: object;
                type: string;
                url: string | null;
                userId: number;
            },
        ) => Promise<object>;
    }
    Index

    Properties

    Properties

    getKey?: (
        data: { data: object; type: string; userId: number },
    ) => Promise<string>

    Optional. Given { type, userId, data }, returns the S3 object key for the upload. If omitted, a UUID is generated.

    onUpload: (
        data: { data: object; type: string; url: string | null; userId: number },
    ) => Promise<object>

    Required. Called after each successful upload with { url, type, userId, data }. The return value is included in the API response as onUploadResponse (e.g. save metadata to your database and return it).