Have your say in Community Polls: What was/is your greatest motivation to start your own business?

How to add an Input File option to Contact form in Dawn theme?

How to add an Input File option to Contact form in Dawn theme?

Kylara
Excursionist
18 0 3

Hi!

 

I figured out how to add the file input into the form with chatgpt however when I tried it it didn't work. It didn't send the message to my shopify email. I think there is some deeper problems that I don't understand.

I was able to make it like so:

Kylara_0-1730700117093.png


Can anyone tell me why it doesn't send the message with the file? And how to fix it?

 

Thanks in advance.

Replies 2 (2)

rajweb
Shopify Partner
366 35 50

Hey @Kylara ,

 

It looks like you've successfully added a file input to your form, but sending form submissions with file attachments in Shopify requires a few additional steps, as Shopify's default forms don't natively support file uploads that are emailed.

Follow these Steps:

1. Shopify Limitations with File Uploads:

-Shopify's default form functionality doesn’t support sending file uploads directly to your email or storing files through Shopify's backend.

-To include files in a form submission, you need an external service or app that handles file uploads and integrates with Shopify.

2. Options to Enable File Uploads:

Here are some ways to enable file uploads in your Shopify form:

 

Option 1: Use a Third-Party Form Builder App

-Shopify offers various form builder apps (e.g., Form Builder by HulkApps, Powerful Contact Form Builder).

-These apps provide advanced form functionalities, including file uploads and the ability to send files as email attachments.

-They often support automated email notifications with file uploads.

 

 Option 2: Custom Solution with an External Server

-If you have access to a server or backend, you can set up a custom form that allows users to upload files.

-This form would need to store the file on your server or in a cloud storage service (like Amazon S3) and then send an email with a link to the file.

-This option requires some coding knowledge, but it’s a flexible way to control file uploads.

3.  Basic Workaround for Shopify:

If you're looking for a quick solution, here’s how you could set up a form without file uploads:

  1. Remove the file input from the form on your Shopify theme.
  2. Encourage customers to email additional attachments separately.
  3. Direct them to include specific details (like an order number or form reference) to match their submission with their email attachment.

Let me know if you'd like more guidance on one of these options!

 

If I was able to help you, please don't forget to Like and mark it as the Solution!
Best Regard,
Rajat Sharma

 

-Need a Shopify developer?
https://rajatweb.dev/
Email: rajat.shopify@gmail.com

akshay_bhatt
Shopify Partner
115 10 13

hi @Kylara ,

first of all ensure the form supports multiple/form-data.

To handle file uploads, the form must have its enctype attribute set to multipart/form-data. For example:

<form action="/your-endpoint" method="post" enctype="multipart/form-data">
    <input type="file" name="file">
    <!-- Other form fields -->
    <button type="submit">Submit</button>
</form>

then check the email configuration

Shopify's built-in email systems don’t automatically handle file attachments in form submissions. If you’re aiming to receive the uploaded file in an email, you may need to:

Use an External App or Integration: Services like Zapier or Shopify apps like Form Builder can help process form submissions and send emails with attachments.

Use Custom Backend Code: If you have access to a server, consider setting up a custom endpoint to process the form data and email it with the attachment.

Alternative: Save the File to a Cloud Service 

As Shopify doesn’t directly support email attachments, you could:

Upload the file to a cloud service like Dropbox or Google Drive.

Include a link to the file in the email.

 

Got it! If you found my suggestions helpful, please consider liking or marking it as a solution.
Your feedback is appreciated! If you have any more questions or need further assistance, just let me know.

Thanks & Regards
Akshay Bhatt

 

 

- Need a Shopify Specialist?
- Custom Design | Advanced Coding | Store Modifications
Email us