Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Type Alias LimeFileUrlType

    LimeFileUrlType: "contents" | "download" | "edit" | "pdf" | "view"

    Types of URLs that can be retrieved for a file

    Different URL types provide different ways to access or interact with files.

    • contents: Raw file contents URL
    • download: URL that triggers a file download
    • edit: URL for editing the file (if supported)
    • pdf: URL for a PDF version of the file (if conversion is available)
    • view: URL for viewing the file inline in the browser
    import type { LimeFileUrlType } from '@limetech/lime-web-components';
    import { PlatformServiceName } from '@limetech/lime-web-components';

    const repository = platform.get(PlatformServiceName.LimeObjectRepository);
    const contract = repository.getObject('deal', 1234)?.getFile('contract');

    const downloadUrl = contract?.getUrl('download');
    const viewUrl = contract?.getUrl('view');
    const pdfUrl = contract?.getUrl('pdf');

    // The type can also come from a variable or a component property
    const type: LimeFileUrlType = 'edit';
    const editUrl = contract?.getUrl(type);