Eric,
I am trying to get the same information entered into the DB file that is entered for an image file (more strictly just the name of the file), in reality all I need is the file name of the .pdf file uploaded to be entered into the DB recordset upon completion of upload.
I have inserted into the products table a field for "FLOOR PLANS", this field needs to contain the name of the .pdf file uploaded. The floor plan is called through a direct link, i.e. <a href="../PDF/Upload/<?php echo $row_WADAProducts['ProductFloorPlan']; ?>">Floor Plans</a>. and opens the .pdf file in a seperate browser window when clicked.
So far I am able to get the .pdf file to upload with only one problem, the recordset for $row_WADAProducts['ProductFloorPlan'] is being set with the value of "1" to which I do not know why and for the life can not figure out why.
Below is the code used in the Products_Insert.php & Products_Update.php for the image (in this case file) parameters array.
<?php
// USED TO CREATE ARRAY TO STORE FLOORPLAN FILE LOCATION INTO DB
// WA_UploadFloorPlan1 Params Start
$WA_UploadFloorPlan1_Params = array();
// WA_UploadFloorPlan1_1 Start
$WA_UploadFloorPlan1_Params["WA_UploadFloorPlan1_1"] = array(
'UploadFolder' => "../PDF/Upload/",
'FileName' => "[FileName]",
'DefaultFileName' => "");
// WA_UploadFloorPlan1_1 End
// WA_UploadFloorPlan1 Params End?>
<?php
// LOADING FLOORPLAN PARAMS INTO UpLoadeStatusStruct
WA_DFP_SetupUploadStatusStruct("WA_UploadFloorPlan1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadFloorPlan1", "ProductFloorPlan", "2", "[NewFileName]_[Increment]", "false", $WA_UploadFloorPlan1_Params);
}
?>
I am not sure if any of the above is the issue however I can tell you that when I set the WA_DFP_UploadFiles("xxx","xxx","x","[xxx]_[xxx]","FALSE","xxx") instead of true I am able to upload the .pdf file without error except for the value="1". If this remains as "true" the error generated is my best guess an "invalid image file" and will not allow the uploader to progress past the error...
...I am able to bi-pass this issue by manually setting the recordset using MySQL with the file name however this is defeating the purpose...