Problem uploading images/attachments on the checkout page

Posts: 37
Joined: 11/28/2007

I'm having a problem that I am pretty sure is related to some sort of Ubercart javscript or form submission issue. Unfortunately, Firebug isn't showing any errors.

I'm stuck when it comes to integrating uploads on the checkout page. Using uc_nodetype, I have been able to insert the nodetype_node_add form onto checkout pages as a pane and then ultimately create nodes when a checkout is complete.

However, I cannot get any of the image uploaders to actually save images or files with a new node. I have tried CCK image, Image, adding an image as an attachment. With CCK image, when I select an image to upload, I get the uploading graphic but the image never really gets attached. Similarly, when uploading a file, when I press "Attach", the file doesn't attach.

There are a few things that I think could be a causing the conflict:
- A conflict between Upload.js or Drupal.js and the Ubercart javascript
- A form handling conflict. I have multiple submit buttons on the same page
- Using drupal_retrieve_form to display the form within a checkout pane when I should be using something else

Bottom line is that I would really appreciate some advice. I've been struggling with this for a few weeks and am totally stuck. I am posting this outside of the uc_nodetype thread because I think that it might be caused by a larger issue.

Posts: 2267
Joined: 08/07/2007
AdministratoreLiTe!

When you uploading files in a form, you need to set the form's "enctype" attribute to "multipart/form-data". See uc_catalog_form_alter() for an example.

Posts: 37
Joined: 11/28/2007

Thanks for the tip. I was able to set uc_cart_checkout_form to multipart/form-data using hook_form_alter. However, this didn't seem to solve the problem.

I should mention that there are actually two forms on the site: uc_cart_checkout_form and resource_node_form. resource_node_form is contained within uc_cart_checkout_form. Both are now set to multipart.

I'd really appreciate any other advice you can offer.

Posts: 37
Joined: 11/28/2007

I've noticed something else that may shed light on the problem.

I'm using imagefield. When I press the "Upload" button, the entire page refreshes instead of calling the AJAX uploader. I experience the same problem when I try to to upload files and press "attach."

Thanks in advance for any help.

Posts: 37
Joined: 11/28/2007

Just wanted to note that this problem is solved. Turns out that it was caused by a conflict with OpenAds.

Posts: 5
Joined: 03/10/2008

How did you solve this problem? I have a similar need to upload a picture during checkout. Any help appreciated!

Posts: 37
Joined: 11/28/2007

I found that the best way to debug the problem was to save a static version of the page in question and then one by one disable each line of javascript. Once I disabled the OpenAds code, the uploader started working again.

Julia