Add an Uploadcare file upload option to product form

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

Configure Uploadcare Widget

  1. Create your free Uploadcare account here.
  2. Create you first Project in Uploadcare here.
  3. From the Get Started page, select File Uploader under the Integrate Uploading section.
  4. Customize your upload widget following Step 1 and Step 2.

Add Widget to Product Form

  1. In your website (or the page where your Foxy product will reside), paste the snippet below right before the closing HEAD tag.
    <script src="https://ucarecdn.com/libs/widget/3.x/uploadcare.full.min.js"></script>
  2. Go back to your Uploadcare widget settings and copy the form input HTML from Step 4.
  3. Paste the form input HTML into your Foxy product form.
  4. Add the "name" parameter to the file input HTML (ex: name="Upload"). The name value can be changed to anything you want. Your Foxy product form HTML should look similar to this:
    <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-public-key="YOUR_PUBLIC_KEY"
        data-system-dialog="true"
        name="Upload"
      />
      <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.

In This Article

Related Articles

Add an Uploadcare file upload field to checkout page

Need help?

Can't find the answers you're looking for? Our team is here to help. Please click below to contact us.

Contact Us