I have a simple script that I am trying to implement in a server CENTOS in a company, this server was installed APACHE from scratch, the PHP script is running normally, but the upload code is not sending the file I need. p>
The code is very simple
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . $_FILES['Arquivo']['name'];
if (move_uploaded_file($_FILES['Arquivo']['tmp_name'], $uploadfile)){
echo "Arquivo Enviado";}
else {echo "Arquivo não enviado";}
On the test server that XAMP is installed on, it works normally, but in this company I can not do anything.
The return of $ _ FILE tells you that it was, but move_uploaded_file does not return
Array
(
[arquivo] => Array
(
[name] => pesos.txt
[type] => text/plain
[tmp_name] => /tmp/phpNMb9dx
[error] => 0
[size] => 592
)
)
Follow the complete return
arquivo_teste (3).txt
/tmp/phpjAlk3m
0
array(1) {
["arquivo"]=>
array(5) {
["name"]=>
string(21) "arquivo_teste (3).txt"
["type"]=>
string(10) "text/plain"
["tmp_name"]=>
string(14) "/tmp/phpjAlk3m"
["error"]=>
int(0)
["size"]=>
int(592)
}
}
Arquivo n�o enviado
And the error LOG
PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpN60QPx' to '/var/www/uploads/pesos.txt' in /var/www/html/sistema/teste.php on line 22, referer: