Insert/Update problem using session id for the image file upload
Hi
To avoid umlauts and empty space in image file names, my insert and update forms use the session id to rename the image file. However, if one uploads more than one or two images the current session doesn't update and the same file appears or doesn't appear as it inputs the same file name based on the session id into the DB.Sometimes the new thumbnail is generated but the main image file is not generated with the successive file name.
Is there a work around such as killing the session and starting a new session or is there another method to do this?
Thanks for any help!
Below is the code I am using:
-----------------------------------------------------------------------------
<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('../../Connections/mysqli2.php'); ?>
<?php require_once('../../webassist/mysqli/rsobj.php'); ?>
<?php require_once("../../webassist/file_manipulation/helperphp.php"); ?>
<?php require_once('../../webassist/mysqli/queryobj.php'); ?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../../upload/katalog/",
'FileName' => "". session_id() ."",
'DefaultFileName' => "",
'ResizeType' => "3",
'ResizeWidth' => "",
'ResizeHeight' => "700",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1_2 Start
$WA_UploadResult1_Params["WA_UploadResult1_2"] = array(
'UploadFolder' => "../../upload/katalog/",
'FileName' => "thumb_". session_id() ."",
'DefaultFileName' => "",
'ResizeType' => "3",
'ResizeWidth' => "",
'ResizeHeight' => "150",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_2 End
// WA_UploadResult1 Params End?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "image", "2", "[NewFileName]_[Increment]", "JPG:80", $WA_UploadResult1_Params);
}
?>
----------------
$InsertQuery->bindColumn("image", "s", "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."", "WA_DEFAULT");
-----------------
$UpdateQuery->bindColumn("image", "s", "".($WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]) ."", "WA_IGNORE");
-----------------