I have a form and I have the following field
<div class="form-group">
<label for="foto">Foto:</label>
<input type="file" name="fileToUpload" id="fileToUpload" accept="image/*" required>
</label>
I need to check through php if the field has been filled
if ($_SERVER["REQUEST_METHOD"] === "POST") {
if (empty($_POST["fileToUpload"])) {
$msg = "Por favor coloque uma imagem!.";
}
}