Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (strlen($file
- ->getFilename()) > 100) {
- $errors[] = t("The file's name exceeds the 100 characters limit.");
- }
- use DrupalCoreFormFormStateInterface;
- function blank_moda_file_validate(DrupalfileFileInterface $file) {
- $errors = array();
- if ($file
- ->getMimeType()) !== jpg, gif) {
- $errors[] = t("The file is not a jpg or gif.");
- }
Add Comment
Please, Sign In to add comment