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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

File Upload Help

Thread began 5/15/2013 1:56 pm by anonymous | Last modified 6/13/2013 3:38 pm by Jason Byrnes | 655 views | 12 replies |

anonymous

File Upload Help

Hi. I would like to allow users to upload files to a folder on my server via the form on my eCart checkout page. Everything on the checkout page except the file field is working correctly (i.e. working fields are passing the data to the confirmation page). I just need the file field to insert the users' filenames to my database and store the the files in a folder on my server. Please take a look at my attached checkout.php file and advise on any problems you may see. Thanks in advance for your help.

Heather

Attached Files
checkout.php
Sign in to reply to this post

Jason ByrnesWebAssist

The checkout form posts to the confirm page.

all form processing must occur on the forms action page.

in this case, the confirm page

the behavior for uploading the file will need to be on the confirm page.

Sign in to reply to this post

anonymous

Thanks, Jason. I thought that would be the case, but I wanted to check first.

Sign in to reply to this post

anonymous

Re: File Upload Help

Hi, Jason. I moved the upload file behavior to the form's action page (confirm.php), but it still doesn't appear to be working. Would you please take a look at the file and give me some direction? It is attached. Many thanks for the help!

Heather

Attached Files
confirm.php
Sign in to reply to this post

Jason ByrnesWebAssist

at line 64, the trigger for the upload is the Submit order button being pressed:

if(isset($_POST["Submit_order"]) || isset($_POST["Submit_order_x"])){


it needs to be the checkout button being pressed:
if(isset($_POST["Checkout"]) || isset($_POST["Checkout_x"])){

Sign in to reply to this post

anonymous

Thanks, Jason, but the checkout button isn't on my confirm page. Can you please take a look again?

Sign in to reply to this post

Jason ByrnesWebAssist

thats the point, the upload happens when the checkout button on the checkout is pressed, that is when the file upload should happen, when the checkout page posts to the confirm page

that is why the trigger needs to be changed to the checkout button being pressed, not the submit order button.

Sign in to reply to this post

anonymous

Thanks, Jason. It is working now. But I'm running into one small problem: It is not storing the filename in my database. I believe I'm using the wrong snippet of code in the Store Summary behavior. Can you please take one more look at the new confirm.php code (attached) and provide some guidance? Thank you for the help!

Heather

Attached Files
confirm.php
Sign in to reply to this post

Jason ByrnesWebAssist

add a hidden form element on the confirm page in the area near the bottom with the other hidden elements.

Bind the initial value of the hidden element to the WA Uploaded Files -> Server File name binding.

in the store order summary behavior, use the hidden element binding.

Sign in to reply to this post

anonymous

Thanks, Jason. I followed your instructions, but it still isn't adding the name to my database. Perhaps I'm not binding it correctly in the store order summary behavior? Attached is the latest file. Please help.

Attached Files
confirm.php
Sign in to reply to this post
loading

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