I'm having trouble uploading an image to a directory, it seems like I'm not writing permission. I already added chmod 775
to the folder and nothing, what could it be?
I have my insert file like this:
<html>
<head>
<title>Teste de upload</title>
</head>
<body>
<form action="#" method="POST" enctype="multipart/form-data">
<input type="file" name="fileUpload">
<input type="submit" value="Enviar">
</form>
</body>
</html>
<?php
if(isset($_FILES['fileUpload']))
{
date_default_timezone_set("Brazil/East"); //Definindo timezone padrão
$ext = strtolower(substr($_FILES['fileUpload']['name'],-4)); //Pegando extensão do arquivo
$new_name = date("Y.m.d-H.i.s") . $ext; //Definindo um novo nome para o arquivo
$dir = './'; //Diretório para uploads
move_uploaded_file($_FILES['fileUpload']['tmp_name'], $dir.$new_name); //Fazer upload do arquivo
}
?>
The errors that are happening are these: