Connect Upload Button
5 min
Use the upload button to allow site visitors to submit files directly to your CMS (Content Management System) collections. You can choose the type of collection field that will store the uploaded files, such as 'Image', 'Document', 'Video', 'Audio', 'Media gallery', or 'Multi-document'. The uploaded files are stored as new items in your collection and in the 'Visitor Uploads' section of your media manager.
How do I choose a dataset?
Connecting to a dataset links the upload button to the CMS collection where the uploads are saved.
Click the Choose a dataset drop-down and select a dataset that connects to the relevant collection. If needed, select Add a dataset, then select the relevant collection and give the dataset a name.
Once you've connected the dataset, click the File connects to drop-down and select the field where the uploads will be saved. Make sure to select the type of field that corresponds with the type of uploads you want to accept.
Choose from the following supported field types: 'Image', 'Document', 'Video', 'Audio', 'Media gallery', or 'Multi-document'. Select Add new field if you need to add the field to your collection where the uploads will be saved.
Learn more about connecting an upload button to the CMS.
Do I need a 'Submit' button to allow visitors to submit their uploaded files?
Yes. Without a 'Submit' button, visitors can still upload the files, but they won't have a way to submit them to your collection.
To add a 'Submit' button:
- Add a regular button in your editor and change the text to 'Submit'.
- Connect the button to the same dataset that connects to your upload button.
- Set the Click action connects to field to Submit.
Learn more about creating a 'Submit' button for the input elements that make up your custom form.
How can I troubleshoot if my upload button is not working?
If your upload button isn't functioning as expected, start by checking the connections of your input elements to ensure they are linked correctly to the appropriate dataset. Verify that the dataset mode is set to either 'Write' or 'Read & Write' to allow data submissions. Additionally, confirm that the collection permissions are set to allow the necessary user roles to add content. Learn more about working with dataset modes and collection permissions.
It's also essential to check for any validation errors that might be preventing the submission. If everything seems correct but the issue persists, consider syncing your sandbox and live collections if applicable. Learn more about troubleshooting user input elements.
How do I connect to a 'Multi-document' field type?
- Select Document from the Supported file type drop-down in the upload button settings.
- Drag the Max number of files slider to set the limit on how many files can be uploaded per submission.
- Click the Connect to CMS icon
on your upload button.
- Click the Choose a dataset drop-down and select an existing dataset that connects to the collection you will store submissions in. Alternatively, select Add a Dataset, then choose the collection you want to store submissions in.
- Add a 'Multi-document' field to your collection where you will store the upload button submissions:
Tip: Alternatively, you can connect to an existing 'Multi-document' collection field.- Click the File connects to drop-down and select Add new field.
- Enter a Field Name for the new collection field.
- Click the Field Type drop-down and select Multi-Document.
- Click Add.
Can visitors submit multiple images or videos with the upload button?
Yes. Make sure to choose Image & Video as the supported file type in the button settings. Then connect the button to a 'Media gallery' field type in your collection.
- In the upload button settings, select Image & Video from the Supported file type drop-down.
- Drag the Max number of files slider to set the limit on how many files can be uploaded per submission.
- Connect the button to a 'Media Gallery' field in your collection:
- Click the Connect to CMS icon
on your upload button.
- Click the Choose a dataset drop-down and select an existing dataset that connects to the collection you will store submissions in. Alternatively, select Add a Dataset, then choose the collection you want to store submissions in.
- Add a 'Media gallery' field to your collection where you will store the upload button submissions:
Tip: Alternatively, you can connect to an existing 'Media gallery' collection field.- Click the File connects to drop-down and select Add new field.
- Enter a Field Name for the new collection field.
- Click the Field Type drop-down and select Media Gallery.
- Click Add.
- Click the Connect to CMS icon
Can I automate what happens when I receive form submissions?
Yes. With Wix Automations, you can choose from a variety of actions that you want to happen when you receive new submissions from your custom form. For example, you could receive an email, send data via webhooks, connect third-party web apps like Google Sheets, or automatically reply back.
To set up automations for CMS form submissions, first ensure the input elements of your form are set up correctly. Then, go to Automations in your site's dashboard and select the CMS form submitted trigger. Set up the actions you want to automate, such as sending emails or creating contacts. This allows you to manage form submissions efficiently.
Learn more about creating automations for CMS form submissions.
How can I allow members to update their own submissions?
To enable site members to update their own submissions, set your collection permissions to 'Advanced' and check the 'Update' option for the 'Item's creator' role. This allows members to edit only the items they created. Ensure your dataset mode is set to 'Read & Write' so that the connected elements can read and update content.
Can I display form submissions in a table, gallery, or repeater?
Yes, you can display form submissions in various formats such as tables, galleries, or repeaters.
Connect your table, gallery or repeater to a dataset that connects to the collection with the submissions. Then make sure the dataset mode is set to 'Read' or 'Read & Write' and that the collection permissions allow the relevant people to view the content.
Did this help?
|
Didn’t find what you’re looking for? Try one of these articles.
Didn’t find what you’re looking for? Try one of these articles.
