close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DA Insert not triggering upload

Thread began 4/12/2010 1:05 pm by Mikel Jones | Last modified 4/13/2010 10:14 am by Jason Byrnes | 905 views | 7 replies |

Mikel Jones

DA Insert not triggering upload

So I created a new page and added an upload behavior to it with no issues. Progress bar, upload and all went fine. The server had the file after the upload and the progress bar worked great.

So added the upload behavior to an existing DA insert page and this is where I ran into problems.

The trigger for the upload does not go off when the insert button is pressed. The upload never happens and the file does not make it to the server.

The trigger for the upload behavior is...

  <?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "BkgImage", "0", "", "false", $WA_UploadResult1_Params);
}
?>  




Now my understanding is that this should go off when the form is posted back to the insert page.

The insert trigger is the following...

  // WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $localhost;
$WA_table = "listing";
...  



This code is triggered based on the $_POST["Insert_x"] array entry and not the POST METHOD.

I attempted to find a way to set the upload to the $_POST["Insert_x"] array entry and was unable to find anything.


What am I missing?

Note: I attached the insert php file as a text file to this post.

...

Attached Files
listing_Insert.txt
Sign in to reply to this post

Jason ByrnesWebAssist

that should be working, to troubleshoot, find the following line of code:
$WA_redirectURL = "listing_Detail.php";

and change it to:
//$WA_redirectURL = "listing_Detail.php";
$WA_redirectURL = "";


then on the bindings panel, expand the WA Uploaded Files Global Status and drag the Debug info binding to the page.

post back the results of the debug info after trying to upload again.

Sign in to reply to this post

Mikel Jones

  Status object: WA_UploadResult1
statusCode : 0
errorMessage : No file uploaded
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
fileSize : -1
isImage :
imageWidth : -1
imageHeight : -1
WA_UploadResult1_1:
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileSize : -1
imageWidth : -1
imageHeight : -1
statusCode : 0
errorMessage : No file uploaded  




Looks like the data isn't getting set.

Sign in to reply to this post

Jason ByrnesWebAssist

for file upload to take place, the forms encoding type needs to be set to multipart/form-data.

change:
<form action="listing_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm">

to:
<form action="listing_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm" enctype="multipart/form-data">

Sign in to reply to this post

Mikel Jones

Originally Said By: Jason Byrnes
  for file upload to take place, the forms encoding type needs to be set to multipart/form-data.

change:
<form action="listing_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm">

to:
<form action="listing_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm" enctype="multipart/form-data">  




That's the ticket! After that change everything works fine now...

I wonder how the insert was working when the POST data type wasn't set to forms data?

So I guess the lesson learned here is that when adding an upload to an existing DA form the data type needs to be changed by hand.

Sign in to reply to this post

Jason ByrnesWebAssist

If you use Dreamweaver to insert the file form field, the encoding type will be changed automatically.

Insert -> Form -> File Field.

Or you can change the encoding type manually in the property inspector. Select the form tag, then change the encoding type dropdown list in the property inspector to multipart/form-data

Sign in to reply to this post

Mikel Jones

Originally Said By: Jason Byrnes
  If you use Dreamweaver to insert the file form field, the encoding type will be changed automatically.

Insert -> Form -> File Field.

Or you can change the encoding type manually in the property inspector. Select the form tag, then change the encoding type dropdown list in the property inspector to multipart/form-data  




Hey, just wanted to let you guys know that the forum responses here are great. Your response time is good and you always do a great job following up on issues.

Sign in to reply to this post

Jason ByrnesWebAssist

thanks for the feedback, we appreciate 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...