Pure PHP Upload 3 Support Product Page

Answered

File upload filename not retained when updating table

Asked 19 Mar 2014 12:03:04
1
has this question
19 Mar 2014 12:03:04 David Woolley posted:
I know this issue has been reported before in another post, but no resolution yet.
Pure PHP Upload 3.02 with DW CS6.
Update Record does not retain the filename of the uploaded file if another field in the table is updated. Insert Record works fine.

I've been trying to resolve this myself for days now but coming up against a brick wall! Endless permutations!
Filename always gets overwritten by NULL in the table.
I'm restricting file extension to zip as I will use the ZIP Processor PHP 3 after I've sorted this issue. Here is the code with the input statement included as well. No redirect yet while I troubleshoot this page.

<?php require_once('../ScriptLibrary/incPureUpload.php'); ?>
<?php 
//*** Pure PHP File Upload 3.0.1
// Process form form1
$ppu = new pureFileUpload();
$ppu->nameConflict = "uniq";
$ppu->storeType = "file";
$ppu->progressBar = "vista_look.htm";
$ppu->progressWidth = 300;
$ppu->progressHeight = 100;
$ppu->path = "../presentations_vm";
$ppu->allowedExtensions = "zip"; // "custom"
$ppu->redirectUrl = "";
$ppu->checkVersion("3.0.1");
$ppu->doUpload();
?>
<?php
// Cancel button before UPDATE RECORD - DGW
if (array_key_exists('Cancel', $_POST)) {
	header('Location: admin.php');
	exit;
}
?>
<?php
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE cases SET category_id=%s, museum_no=%s, case_no=%s, other_ref_no=%s, snomed=%s, icd10=%s, title=%s, patientdata=%s, grosspathology=%s, histology=%s, `comment`=%s, presentation=%s, web_url=%s, anat_diag=%s, `references`=%s WHERE case_id=%s",
                       GetSQLValueString($_POST['category_id'], "int"),
                       GetSQLValueString($_POST['museum_no'], "text"),
                       GetSQLValueString($_POST['case_no'], "text"),
                       GetSQLValueString($_POST['other_ref_no'], "text"),
                       GetSQLValueString($_POST['snomed'], "text"),
                       GetSQLValueString($_POST['icd10'], "text"),
                       GetSQLValueString($_POST['title'], "text"),
                       GetSQLValueString($_POST['patientdata'], "text"),
                       GetSQLValueString($_POST['grosspathology'], "text"),
                       GetSQLValueString($_POST['histology'], "text"),
                       GetSQLValueString($_POST['comment'], "text"),
                       GetSQLValueString($ppu->files("presentation")->fileName, "text"),
                       GetSQLValueString($_POST['web_url'], "text"),
                       GetSQLValueString($_POST['anat_diag'], "text"),
                       GetSQLValueString($_POST['references'], "text"),
                       GetSQLValueString($_POST['case_id'], "int"));

  mysql_select_db($database_connDigiPath, $connDigiPath);
  $Result1 = mysql_query($updateSQL, $connDigiPath) or die(mysql_error());
}
?>
.
.
.
<input name="presentation" type="file" id="presentation" onchange="<?php echo $ppu->getValidateCode() ?>;return document.MM_returnValue" value="<?php echo $row_rsCases['presentation']; ?>" size="32" />

Replies

Replied 30 May 2024 11:04:56
30 May 2024 11:04:56 User  replied:
it's miles a gratifying internet site.. The design seems thoroughly to your liking.. hold enthusiastic later that!. telegram中文
Replied 19 Jun 2024 10:09:19
19 Jun 2024 10:09:19 User  replied:
I'm Komal Kaur, an escort that loves to party hard and never says no to a good time with guys who can make me feel like a rock star again.
Jaipur Escorts Service

Reply to this topic