Zen Cart Logo
Forums / General Questions / Where are file uploads handled?

Where are file uploads handled?

Views: 681

Results 1 to 3 of 3
29 May 2013, 8:51 PM
#1
allthingsidleroy avatar

allthingsidleroy

New Zenner

Join Date:
May 2013
Posts:
38
Plugin Contributions:
0

Where are file uploads handled?

For my store, I'm creating an optional file upload form for artwork after a customer has made a purchase. Thus far, I have edited the define_checkout_success.php with an upload form (I am using the CSRF token with the upload form). I have created an attribute for file upload for a product to do research and learned that the "number_of_uploads" get paramater is set to 1 for this specific product when submitting the form.

I can't seem to find where the process happens after that point. The file is uploaded, I can see it on my server and the database gets updated. I would like to use the same function that handles the process here (after adding a product to the cart) that's obviously already built into Zencart for my optional artwork upload.

So, I'm pretty sure I could just set the action of the form to a specific pages that already handles file uploads, but I can't seem to get everything in line.

Thanks for any information.

29 May 2013, 9:04 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Where are file uploads handled?

There is no built-in support for uploads on the checkout_success page.

The cart is designed to have customers select their uploadable files (in your case, the "artwork") on the product page via a "File" attribute which you've added to that product. They select the file before adding the product to their cart, and then the file is uploaded when adding to cart and then stored and linked to the order when the purchase is completed.
Changing that will require you writing your own additional custom code to be a whole new page to handle unrelated uploads, and then find a way to link them back to the order.

29 May 2013, 9:20 PM
#3
allthingsidleroy avatar

allthingsidleroy

New Zenner

Join Date:
May 2013
Posts:
38
Plugin Contributions:
0

Re: Where are file uploads handled?

I thought as much, but I figured I might ask to see if anyone else got a to file upload using this method:

DrByte:

They select the file before adding the product to their cart, and then the file is uploaded when adding to cart . . .

Because that functionality works fairly well, is already implemented, and is mostly hidden (and would be less code for me to write/keep up with!).

Thanks.