We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transfer to the validation method
Before:
$filename = $_FILES['file']['name']; $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); //Walidacja Rozszerzenia $finfo = finfo_open(FILEINFO_MIME_TYPE); $mime = finfo_file($finfo, $_FILES['file']['tmp_name']); //Walidacja Mine finfo_close($finfo); if (!in_array($mime, ['application/pdf']) OR !in_array($extension, ['pdf'])) { return Response::renderJSON(['code' => 403, 'message' => 'Allowed only: \'pdf\'']) ->status(403) ->display(); }
After:
$FileStorage->isAllowedFileType($filename, ['pdf'])
The text was updated successfully, but these errors were encountered:
98c8732
No branches or pull requests
Transfer to the validation method
Before:
After:
The text was updated successfully, but these errors were encountered: