close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple image upload

Thread began 10/31/2012 7:38 am by john70964 | Last modified 11/01/2012 10:14 am by Jason Byrnes | 2134 views | 7 replies |

john70964

Multiple image upload

I have two file fields in a submit form to a table
Each file field should submit a main image and a thumb

Both main images are inserted but only one thumb.

The thumb images for Image2 is not inserted.

I copied the Bindings from the Insert Single Record SB I am using.
Image2 looks rather short but is inserting the correct information.
Bindings below.
Image1 <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["WA_UploadResult1_1"]["serverFileName"]; ?>
Image1_thumb <?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["WA_UploadResult1_2"]["serverFileName"]; ?>
Image2 <?php echo $WA_DFP_UploadStatus["WA_UploadResult2"]["serverFileName"]; ?>
Image2_thumb <?php echo $WA_DFP_UploadStatus["WA_UploadResult2"]["WA_UploadResult2_2"]["serverFileName"]; ?>
I also attach a copy of the file in the hope you can see where I am going wrong.
Many thanks
John

Attached Files
insert_images.zip
Sign in to reply to this post

Jason ByrnesWebAssist

to help troubleshoot the problem, well need to make a few changes to the page to get some aditional information.

1) add the following code at line 1 to turn on error reporting:

php:
<?php
error_reporting
(E_ALL);
ini_set('display_errrors','on');
?>



2) remove the redirect URL. Change:

php:
$WA_redirectURL = "thankyou.php";



to:

php:
$WA_redirectURL = "";



3) Echo the insert SQL.

change the following code:

php:
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());



to:

php:
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
echo("SQL: ".$WA_Sql."<br />");
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());



4) output the files array to the page.

add the following code just before the </body> tag:

php:
<?php var_dump($_FILES); ?>



5) Add the debug info bindings. Go to the bindings panel and expand the WA Uploaded Files binding Global Status binding group and drag the debug info binding to the page.

this will add a bunch of information to the page after testing it again, post this information back please.

Sign in to reply to this post

john70964

Thank you Jason

Please find information displayed on test page

Attached Files
Infomation from Page.txt
Sign in to reply to this post

john70964

This post has been deleted.

Jason ByrnesWebAssist

this looks like the information before testing the insert.

I need the information on the page after trying the insert. It should also include the insert SQL.

Sign in to reply to this post

john70964

I hope I now have it below?

array(2) { ["Image1"]=> array(5) { ["name"]=> string(11) "cai2070.jpg" ["type"]=> string(10) "image/jpeg" ["tmp_name"]=> string(22) "C:\xampp\tmp\php64.tmp" ["error"]=> int(0) ["size"]=> int(33951) } ["Image2"]=> array(5) { ["name"]=> string(11) "cai2071.jpg" ["type"]=> string(10) "image/jpeg" ["tmp_name"]=> string(22) "C:\xampp\tmp\php65.tmp" ["error"]=> int(0) ["size"]=> int(30472) } } Status object: WA_UploadResult1
statusCode : 1
errorMessage :
clientFileName : cai2070.jpg
fileExtension : jpg
serverFileName : cai2070_12.jpg
serverSimpleFileName : cai2070_12
serverDirectory : boatimages\
contentType : image/jpeg
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed : 1
fileSize : 24982
isImage : 1
imageWidth : 345
imageHeight : 650
WA_UploadResult1_1:
clientFileName : cai2070.jpg
fileExtension : jpg
serverFileName : cai2070_12.jpg
serverSimpleFileName : cai2070_12
serverDirectory : boatimages\
contentType : image/jpeg
fileSize : 24982
imageWidth : 345
imageHeight : 650
isImage : 1
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed : 1
statusCode : 1
WA_UploadResult1_2:
clientFileName : cai2070.jpg
fileExtension : jpg
serverFileName : cai2070_thumb_12.jpg
serverSimpleFileName : cai2070_thumb_12
serverDirectory : boatimages\
contentType : image/jpeg
fileSize : 5368
imageWidth : 120
imageHeight : 226
isImage : 1
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed : 1
statusCode : 1
Status object: WA_UploadResult2
statusCode : 1
errorMessage :
clientFileName : cai2071.jpg
fileExtension : jpg
serverFileName : cai2071_7.jpg
serverSimpleFileName : cai2071_7
serverDirectory : boatimages\
contentType : image/jpeg
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed : 1
fileSize : 18389
isImage : 1
imageWidth : 345
imageHeight : 650
WA_UploadResult2_1:
clientFileName : cai2071.jpg
fileExtension : jpg
serverFileName : cai2071_7.jpg
serverSimpleFileName : cai2071_7
serverDirectory : boatimages\
contentType : image/jpeg
fileSize : 18389
imageWidth : 345
imageHeight : 650
isImage : 1
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed : 1
statusCode : 1
WA_UploadResult2_2:
clientFileName : cai2071.jpg
fileExtension : jpg
serverFileName : cai2071_thumb_7.jpg
serverSimpleFileName : cai2071_thumb_7
serverDirectory : boatimages\
contentType : image/jpeg
fileSize : 4597
imageWidth : 120
imageHeight : 226
isImage : 1
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed : 1
statusCode : 1

Sign in to reply to this post

Jason ByrnesWebAssist

you don't include the SQL?

Sign in to reply to this post

john70964

My apologies Jason
I copied my original file to send to you to show why it was not working.

Just now I decided to send you a fresh copy ammended as required.

I decided to give my original copy another test and its working OK.

I have no idea why this has happened. Most strange.

Sign in to reply to this post

Jason ByrnesWebAssist

Ok, if it happens again, let us know and we con look into it.

Sign in to reply to this post

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...