1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00
appwrite/src/Appwrite/Storage/Validator/Upload.php
2020-10-27 21:44:15 +02:00

34 lines
549 B
PHP

<?php
namespace Appwrite\Storage\Validator;
use Utopia\Validator;
class Upload extends Validator
{
public function getDescription()
{
return 'Not a valid upload file';
}
/**
* Check if a file is a valid upload file
*
* @param mixed $path
*
* @return bool
*/
public function isValid($path)
{
if (!is_string($path)) {
return false;
}
if (\is_uploaded_file($path)) {
return true;
}
return false;
}
}