0
Well I am with the following doubt, it is possible to create a directory with mkdir and in the same PHP code insert uploads files in this created directory?
For example I have a form where I receive files by upload, and I would like to create a folder and throw these files in it at the same time, it is possible to do this all in the same code in a way that uses only one action?
PHP code:
$vregistro = utf8_decode($_POST['f_registro']); //Recebe valor de um input
mkdir("C:\test\Arquivos\Documentos/$vregistro", 0777, true);
//Cria uma pasta com o nome designado na variável
$uploaddir = 'C:\test\Arquivos\Documentos/';
$uploadfile = $uploaddir . basename($_FILES['fanexo']['name']);
echo
if (move_uploaded_file($_FILES['fanexo']['tmp_name'], $uploadfile)) {
yes it is possible, post your code
– MagicHat
Post the code, please.
– Brunno Vianna