close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Insert/Update problem using session id for the image file upload

Thread began 9/19/2018 1:34 am by astrostrom | Last modified 9/24/2018 11:34 am by astrostrom | 1747 views | 9 replies

astrostrom

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");

-----------------

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...