this is going to take some hand coding to pull off.
you will need to store the server file name of the uploaded files into a session variable array.
then, set up a single insert record behavior that has an array loop around it.
by naming a session with "[]" it will create an array, for example:
$_SESSION['uploadedFiles'][]
use the following code after the upload file behaviors to store the uploaded files into the session array:
<?php
if($WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"] == "1") $_SESSION['uploadedFiles'][] = $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"];
if($WA_DFP_UploadStatus["WA_UploadResult2"]["statusCode"] == "1") $_SESSION['uploadedFiles'][] = $WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"];
if($WA_DFP_UploadStatus["WA_UploadResult3"]["statusCode"] == "1") $_SESSION['uploadedFiles'][] = $WA_DFP_UploadStatus["WA_UploadResult3"]["serverFileName"];
if($WA_DFP_UploadStatus["WA_UploadResult4"]["statusCode"] == "1") $_SESSION['uploadedFiles'][] = $WA_DFP_UploadStatus["WA_UploadResult4"]["serverFileName"];
if($WA_DFP_UploadStatus["WA_UploadResult5"]["statusCode"] == "1") $_SESSION['uploadedFiles'][] = $WA_DFP_UploadStatus["WA_UploadResult5"]["serverFileName"];
?>
then add the insert record behavior to the page, for the column that will store the file name, paste the following code into the value box:
<?php echo $_SESSION['uploadedFiles'][i]; ?>
now add an array loop around the insert behavior:
<?php for($i = 0; $i < sizeof($_SESSION['uploadedFiles']); $i++) { ?>
<insert record code here>
<?php } ?>
<?php
if(sizeof($_SESSION['uploadedFiles']) > 0) {
unset($_SESSION['uploadedFiles']);
header("Location: successpage.php");
}
the second if will unset the session and redirect to the success page.
Is this code still useable?
Cos its what i need to get my multiupload to work with out a loads of empty posts in my db.
Ah well i try it out! :)
You guys at WA should really build that multiupload in to DataBridge, old Interakts extention had a awesome one, ctrl + click any file/files, bam right in the kisser, i mean in to the database, easy as making pie. :)
/Morgan