The extension is doubled
Hello
I have entered the name of the variable, but what happens now is that the extension is duplicated.
In other words, if you upload a file called:
Vídeo ensayo Matrícula 2134569.mov
Your name changes to:
2019-01-24_Video-ensayo-Matricula.mov.mov
I re-copy the code (only the part corresponding to the upload of the video):
----
<?php
//SCRIPTS renombrar, subir e insertar, dejar mensajes
$statusMsg = '';
function replace_specials_characters($s) {
$s = preg_replace("/á|à|â|ã|ª/","a",$s);
$s = preg_replace("/Á|À|Â|Ã/","A",$s);
$s = preg_replace("/é|è|ê/","e",$s);
$s = preg_replace("/É|È|Ê/","E",$s);
$s = preg_replace("/í|ì|î/","i",$s);
$s = preg_replace("/Í|Ì|Î/","I",$s);
$s = preg_replace("/ó|ò|ô|õ|º/","o",$s);
$s = preg_replace("/Ó|Ò|Ô|Õ/","O",$s);
$s = preg_replace("/ú|ù|û|ü/","u",$s);
$s = preg_replace("/Ú|Ù|Û/","U",$s);
$s = str_replace(" ","-",$s);
$s = str_replace("ñ","n",$s);
$s = str_replace("Ñ","N",$s);
$s = preg_replace('/[^a-zA-Z0-9_.-]/', '-', $s);
return $s;
}
//campo file: V1Pru
//boton: FAIV1
//form: FAIv1Pru
//reemplazar caracteres ilegales y añadir la fecha al nombre
if(isset($_POST["FAIV1"]) && !empty($_FILES["V1Pru"]["name"])){
$dataV = date('Y-m-d');
$nombreVideo = replace_specials_characters($_FILES["V1Pru"]["name"]);
$nombreVideoBBDD = $dataV."_".$nombreVideo;
}
/ WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "__02_video_pru/",
'FileName' => "$nombreVideoBBDD",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End?>
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["FAIV1"]) || isset($_POST["FAIV1_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "V1Pru", "2", "$nombreVideoBBDD", "false", $WA_UploadResult1_Params);
}
?>
----
I do not understand why this happens. Can someone give me a clue?
Thank you