Add a file upload option to product form

In this tutorial we show you how to add a file upload option to Foxy products that will send files to your Uploadcare account.

Note

A form based product is required when adding an Uploadcare file upload option.

In this article

Configure Uploadcare Widget

1
Create your free Uploadcare account here.
2
Create you first Project in Uploadcare here.
3
Configure your widget here.

Add Widget to Product Form

1
Copy/paste the script snippet from your Uploadcare widget settings.
2
In your website (or the page where your Foxy product will reside), paste the snippet right before the closing HEAD tag.
3
Go back to your Uploadcare widget settings and copy the form input HTML.
4
Paste the form input HTML into your Foxy product form.
5

Add the "name" parameter to the file input HTML (ie: name="uploads") The name value can be changed to anything you want. Your HTML should look similar to the following:

<form action="https://YOUR-SUBDOMAIN.foxycart.com/cart" method="post" accept-charset="utf-8">
<input type="hidden" name="name" value="My Product" />
<input type="hidden" name="price" value="10" />
<input type="hidden" role="uploadcare-uploader" data-multiple="true" name="uploads" required />
<input type="submit" value="Add To Cart" class="submit" />
</form>
	

Accessing Uploaded Files

A link to uploaded file(s) will be available in the receipt (both web and email) along with transaction details in the Foxy admin here.