J'ai une page pour uploader un fichier video(mpg, mpeg, avi ou wmv)
Le problème, c'est que ca marche pour certains fichiers mais pas pour d'autres !!???
voici le code simplifié de ma page : ("page.php?action=1")
<?php
$action=$_GET["action"];
if($action==null)$action=$_POST["action"];
$nom=$_POST["nom"];
$ext=$_POST["ext"];
if($action==1)
{
?>
<HTML>
<HEAD>
<script>
function valid(){
var ext=monForm.fichier.value;
var index1 = ext.lastIndexOf('.')+1;
var index2 = ext.length;
ext = ext.substring(index1,index2);
ext = ext.toLowerCase();
if((ext=="mpg")||(ext=="mpeg")||(ext=="avi")||(ext=="wmv"))
{monForm.ext.value=ext;monForm.submit();}
else alert('Mauvais format de fichier.');
}
</script>
</HEAD>
<form name="monForm" ENCTYPE="multipart/form-data" method="POST" action="<?php echo $PHP_SELF;?>">
Nom : ,
,