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);
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 URLdownload: URL that triggers a file downloadedit: 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