Guest User

Untitled

a guest
May 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. if (strlen($file
  2. ->getFilename()) > 100) {
  3. $errors[] = t("The file's name exceeds the 100 characters limit.");
  4. }
  5.  
  6. use DrupalCoreFormFormStateInterface;
  7. function blank_moda_file_validate(DrupalfileFileInterface $file) {
  8. $errors = array();
  9.  
  10. if ($file
  11. ->getMimeType()) !== jpg, gif) {
  12. $errors[] = t("The file is not a jpg or gif.");
  13. }
Add Comment
Please, Sign In to add comment