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.
A form based product is required when adding an Uploadcare file upload option.
In this article
Configure Uploadcare Widget
- Create your free Uploadcare account here.
- Create you first Project in Uploadcare here.
- Configure your widget here.
Add Widget to Product Form
- Copy/paste the script snippet from your Uploadcare widget settings.
- In your website (or the page where your Foxy product will reside), paste the snippet right before the closing HEAD tag.
- Go back to your Uploadcare widget settings and copy the form input HTML.
- Paste the form input HTML into your Foxy product form.
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.