AllaerdUploadErrorMessages

The Woocommerce CSV Import Allaerd UploadErrorMessages class.

Defined (1)

The class is defined in the following location(s).

/src/Allaerd/UploadErrorMessages.php  
  1. class UploadErrorMessages 
  2. /** 
  3. * Convert an upload error number to a message 
  4. * @param $code 
  5. * @return string 
  6. */ 
  7. public static function convertErrorToMessage($code) 
  8. switch ($code) { 
  9. case 1: 
  10. $message = "The uploaded file exceeds the upload_max_filesize directive in php.ini"; 
  11. break; 
  12. case 2: 
  13. $message = "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"; 
  14. break; 
  15. case 3: 
  16. $message = "The uploaded file was only partially uploaded"; 
  17. break; 
  18. case 4: 
  19. $message = "No file was uploaded"; 
  20. break; 
  21. case 5: 
  22. $message = "Missing a temporary folder"; 
  23. break; 
  24. case 6: 
  25. $message = "Failed to write file to disk"; 
  26. break; 
  27. case 7: 
  28. $message = "File upload stopped by extension"; 
  29. break; 
  30.  
  31. default: 
  32. $message = "Unknown upload error"; 
  33. break; 
  34.  
  35. return $message;