Image upload not named as specified
I am trying to set it up so that when a user uploads an image file it gets renamed to CardImage.jpg and always overwrites a file of the same name if it exists on the server.
The code below (generated by your File Manipulation app) uploads to the correct folder but always names the file something like this "13510636624cb9dd104e8642.61168118.jpg". Every time I submit the form it uploads another file with a similar file name. It never names it CardImage.jpg.
Have I specified something incorrectly? I'm guessing these filenames are the temp name that is uploaded. What can I do to accomplish what I want?
Thanks in advance for your advice.
Regards,
Thom
<?php require_once("../webassist/file_manipulation/helperphp.php"); ?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "CardImages/",
'FileName' => "CardImages/CardImage.jpg",
'DefaultFileName' => "CardImages/CardImage.jpg",
'ResizeType' => "3",
'ResizeWidth' => "120",
'ResizeHeight' => "100",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if((((isset($_POST["button"]))?$_POST["button"]:"") != "")){
WA_DFP_UploadFiles("WA_UploadResult1", "Upload", "0", "", "JPG:80", $WA_UploadResult1_Params);
$URL="Step2.php";
header ("Location: $URL");
}
?>