-2
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="fileUpload"/><br/>
<button type="submit">Enviar</button>
</form>
<?php
if ($_SERVER["REQUEST_METHOD"]==="POST"){
$file = isset($_FILES["fileUpload"])?$_FILES["fileUpload"]:"";
if($file["error"]){
}
$dirUploads = "uploads";
if(!is_dir($dirUploads)){
mkdir($dirUploads);
}
if (move_uploaded_file($file["tmp_name"],$dirUploads.DIRECTORY_SEPARATOR.$file["name"])){
echo "upload realizado com sucesso"."<br>";
}else{
throw new Exception("Não foi possivel fazer o upload");
}
}
?>
What is the error message?
– Guilherme Nascimento
does not give any error, simply does not send
– Rebeca Aguirrer
Then the message appears
upload realizado com sucesso
?– Guilherme Nascimento
yes, but if I send a small file send normal, but if I send a file of some 3mb it simply won’t go
– Rebeca Aguirrer
this on your computer or server?
– Guilherme Nascimento
This question probably solves your problem: https://answall.com/q/15573/3635 (answer: https://answall.com/a/15641/3635)
– Guilherme Nascimento
thanks friend .
– Rebeca Aguirrer