1
After uploading the file, and sending the form information to PHP page, I receive the file with $_FILES['MyFile']
. After receiving the file, I move it to another folder of my system:
if (move_uploaded_file($_FILES['MyFile']['tmp_name'], $uploaddir.basename($_FILES['MyFile']['name'])){ ...
My problem is. After moving this file to a new directory, I cannot read it in the new directory. To illustrate I’ll leave a part of the code here:
$fil = $_FILES['file-intimacao'];
$uploaddir = 'files/';
$files = '';
if(move_uploaded_file($fil['tmp_name'], $uploaddir.basename($fil['name']))){
$files = $uploaddir.$fil['name']; // novo diretório do arquivo
$teste = file_exists ( $files ); //$teste me retorna falso, não me deixando utilizar o arquivo.
}
the directory has read permissions?
– Miguel Borges
Have you checked the directory
files
is with reading and writing permission?– Kazzkiq
Excuse the ignorance, but if it is described in properties of the folder, this "read only". But I can’t get this"
– Douglas Bernardino
@Kazzkiq ? Miguel Borges ?
– Douglas Bernardino
As you are trying to move a file to this folder through PHP, it needs to have "write" enabled as well, otherwise the operating system will bar the server action. To change this option you need to be computer administrator.
– Kazzkiq