ciao a tutti

il mio problema è fare in modo che venga eseguito l'upload di file con esetnsione .pdf .doc e .docx

il form è

<FORM action="upload1CV.php" method="post" enctype="multipart/form-data" name="form1">
<TABLE border="0" cellpadding="2" cellspacing="1" class="testo12">
<TR>
<TD colspan="2"><DIV align="center">Attenzione!

Caricare solo files con estensione .doc (file Word)!



</DIV></TD>
</TR>
<TR>
<TD width="29">File: </TD>
<TD width="260"><INPUT name="attach1" type="file" id="attach1" size="30"></TD>
</TR>
<TR align="center">
<TD colspan="2"><INPUT type="submit" name="Submit" value="Carica"></TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>




LO ELABORA QUESTO:

<style type="text/css">
<!--
body {
background-color: #c8cde0;
}
-->
</style><?
session_start();
//se è stato caricato un cv, controllo l'estensione e il nome del file
if ($attach1_name!="") {
$extensions = array(".doc", ".DOC"); //estensione accettata
$ext = strrchr($attach1_name,'.');
if ((!in_array($ext,$extensions))) {
header("Location: errore_uploadCV.php");
exit;
}
$attach1_1=str_replace(" ", "_"," ", "_"," ", "_", $attach1_name);
$attach1_2=str_replace("'", "_", $attach1_1);
$attach1_3=str_replace("$", "_", $attach1_2);
$attach1_4=str_replace("%", "_", $attach1_3);
$attach1_5=str_replace("/", "_", $attach1_4);
$attach1_6=str_replace("\\", "_", $attach1_5);
$attach1_7=str_replace("?", "_", $attach1_6);
$attach1_8=str_replace("<", "_", $attach1_7);
$attach1_9=str_replace(">", "_", $attach1_8);
$attach1_10=str_replace("|", "_", $attach1_9);
$attach1_11=str_replace("*", "_", $attach1_10);
$attach1_12=str_replace(":", "_", $attach1_11);
$attach1_corretto=session_id().$attach1_12; //gli attacco l'id di sessione per renderlo unico

$_SESSION['cv'] = $attach1_corretto;

#copio il file in una nuova posizione
copy($attach1,"../../upload/$attach1_corretto");
# cancella il file temporaneo
unlink($attach1);

header("Location: upload3CV.php");
exit;
}
?>