Adding a custom file field to a registration form

Adding a custom file field to a registration form

Sara_apr
Shopify Partner
11 0 0

I have added this input to the registration form.
<div class="field">
<label for="Upload">{{ 'Upload' }}<span aria-hidden="true">*</span></label>
<input required="required" type="file" name="customer[note][Upload]" class="full {% if form.errors contains 'Upload' %}invalid{% endif %}" value="" placeholder="{{ '' }}" aria-required="true" />
</div>
is there any possibility to pass the url of the file to URL metafield when user register?
now I just can see the name of the file in Note. if I can see the url of that, then I can update the meta field value.

Replies 6 (6)

LuffyOnePiece
Shopify Partner
645 93 117

Hi @Sara_apr ,

 

We cannot pass the URL using the input type file.

 

First we have to setup a middleware for the file upload and on file upload we will get the URL.

The URL then can be passed in the customer metafield as well as customer notes.

 

Let me know if you need any assistance.

 

Thank you

Sandeep Pangeni
Need help with your store? [email protected]
For quick response, Contact In WhatsApp +9779867521184
Sara_apr
Shopify Partner
11 0 0

Hi
Thanks for your reply. Can you recommend me a middleware for shopify?
is there any tutorial about it? I am new in shopify 

LuffyOnePiece
Shopify Partner
645 93 117

HI @Sara_apr ,

 

We do have to add the middleware in the server.

Do you have cpanel for it?

 

As I can't find any tutorial but I can assist you with the code.

 

Thank you

 

Sandeep Pangeni
Need help with your store? [email protected]
For quick response, Contact In WhatsApp +9779867521184
Sara_apr
Shopify Partner
11 0 0

No unfortunately my webhost doesn't have cpanel

LuffyOnePiece
Shopify Partner
645 93 117

Hi @Sara_apr ,

 

I can host it on my cpanel incase you need that feature.

 

Thank you

Sandeep Pangeni
Need help with your store? [email protected]
For quick response, Contact In WhatsApp +9779867521184

Brett_Helium
Shopify Partner
279 52 125

Hey @Sara_apr! If you are still looking for a solution for this, one option would be something like the Helium Customer Fields app, which lets you create custom registration forms, including adding fields for file uploads. When a file is collected through the form, it will be saved to the app's database, and a URL reference for the file will also be saved into a metafield on the customer's account.

Brett | Helium
- Customer Fields ✪✪✪✪✪ (360+ reviews)
- Meteor Mega Menu ✪✪✪✪✪ (290+ reviews)
- Strike Automatic Discounts NEW!