Ciao a tutti,
ho un problema banale, ma non essendo un mago del php non riesco a venirne fuori:
Codice PHP:
<?php
//istanzia var timestamp
$today = date("Ymdhms");
$todays="ppp";
//se non esiste,crea la directory (attivare i permessi di scrittura!)
if(!is_dir("./files".$today)) mkdir("./files".$today, 0755);
//trasferisce il file uploadto
move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']);
//permessi scrittura
chmod("./files/".$_FILES['Filedata']['name'], 0777);
?>
Il problema è in "./files/".$_FILES['Filedata']['name']);
perché non ho più solo la cartella "files", ma gli ho aggiunto un timestamp $today
"./files".$today
come faccio quindi a cambiare il path?
ho provato ad istanziare
$foldPath="./files".$today
e quindi
move_uploaded_file($_FILES['Filedata']['tmp_name'], $foldPath.$_FILES['Filedata']['name']);
ma non funge 