On file upload, if file exists and no new file is selected for upload, leave existing
Another thing I'm trying to achieve is - I have the File Upload function working, but I don't want it to erase what's already there on the UPDATE page when there's no file selected. (I have 3 actually). I have tried the codes's below, but it always gets erased:
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_FILES["Image"]["name"] == "") {
if(isset($_POST["Update"]) || isset($_POST["Update_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "Image", "0", "", "true", $WA_UploadResult1_Params);
}
}
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult2");
if(!empty($_FILES)) {
if(isset($_POST["Update"]) || isset($_POST["Update_x"])){
WA_DFP_UploadFiles("WA_UploadResult2", "Image2", "0", "", "true", $WA_UploadResult2_Params);
}
}
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult3");
if(!empty($_FILES['Image3'])) {
if(isset($_POST["Update"]) || isset($_POST["Update_x"])){
WA_DFP_UploadFiles("WA_UploadResult3", "Image3", "0", "", "true", $WA_UploadResult3_Params);
}
}
?>