Channel Form

You have two options for connecting an Assets field to a Channel Form.

Showing the full Assets field

If you want to show the full Assets field (the same thing you see in your Publish page), use Channel Form’s official syntax:


Using a file input

If you’d rather just give your form a simple file input, you can do that instead:

<input type="file" name="assets_field_name">

You can add multiple="multiple" to the file input as well, if you want to support multiple file uploads in modern browsers.

You must also define which upload directory or external source the file will get uploaded to, by creating a hidden input whose name is set to your Assets field name, suffixed with either _filedir if you’re uploading to an upload directory, or _source if you’re uploading to an external source. The value should be the ID of the upload directory or external source, and whose value is the upload directory ID:

<input type="hidden" name="assets_field_name_filedir" value="1">
<input type="hidden" name="assets_field_name_source" value="1">