File Uploads for Web Forms
If you don’t want those, there is a way to route your web forms through
Uploadcare, so that we upload files submitted with your form and resend that
form with no actual files but their UUIDs to a URL of your choice. All you have
to do is point your form’s
action attribute to
https://upload.uploadcare.com/submit/ and place your initial
action value in
a hidden field named
Defines a target project your uploads will go to, by its public key.
Sets the URL to resubmit your form with file UUIDs to.
UPLOADCARE_ACTION is missing, the method returns an error:
[HTTP 400] UPLOADCARE_ACTION is required.
If your provided URL is invalid, the method returns an error:
[HTTP 400] UPLOADCARE_ACTION should be a valid URL.
Sets the file storing behavior. Once stored, files are not deleted after a 24-hour period. Accepted values are:
0or not set — files do not get stored upon uploading.
1— files get stored upon uploading. Requires the “automatic file storing” setting to be enabled.
auto— file storing works in line with your project settings.
Any other form fields, including files. Any field names are valid. All file fields are replaced with their respective UUIDs on form resend.
Here is a basic setup to use the feature:
<form method="POST" enctype="multipart/form-data" action="https://upload.uploadcare.com/submit/"> <input type="hidden" name="UPLOADCARE_PUB_KEY" value="demopublickey"> <input type="hidden" name="UPLOADCARE_ACTION" value="https://my-app.com/my-form-handler/"> <input type="file" name="my-file"> </form>