UE File Upload overwite error
This could be on my part because I don't know a lot about php. I can upload a file just fine and name it to a session variable but if I do it again and want to overwrite it it creates a second file with the same extension. For example it will create two files:
picture1.jpg
picture1.jpg.jpg
Code:
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "images/attractions/",
'FileName' => "".$_SESSION['attractionpic'] ."",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "fileupload", "0", "", "false", $WA_UploadResult1_Params);
}
?>
Could somebody please help me as I don't want it to be named [FileName] but rather the session variable. Thanks in advance.