Beta
Result of LimeFileRepository.validate.
import { PlatformServiceName } from '@limetech/lime-web-components';declare const file: File;declare const showError: (code: string) => void;async function checkBeforeUpload() { const files = platform.get(PlatformServiceName.LimeFileRepository); const { valid, errors } = await files.validate(file); if (!valid) { for (const error of errors) { showError(error.code); } }}void checkBeforeUpload(); Copy
import { PlatformServiceName } from '@limetech/lime-web-components';declare const file: File;declare const showError: (code: string) => void;async function checkBeforeUpload() { const files = platform.get(PlatformServiceName.LimeFileRepository); const { valid, errors } = await files.validate(file); if (!valid) { for (const error of errors) { showError(error.code); } }}void checkBeforeUpload();
One entry per failed rule. Empty when valid is true.
valid
true
true when no rule failed.
Result of LimeFileRepository.validate.
Example: Show validation errors before uploading