[ Close ] Introducing Carbon Fields Version 3 - now with Gutenberg Blocks Support


Documentation > Fields > File


Renders a file upload field with a preview thumbnail of the uploaded file. The built-in WordPress file handling interface is used.

This field type stores the ID of the selected file.

Setup methods


Set the allowed files type. Short mime types are also supported (audio, video, image).


Set the type of the stored value. (defaults to id)

You can also url to store the URL of the file instead of the ID.

Field::make("file", "crb_price_list", "Price list (PDF)")

Excited about Carbon Fields? Spread the word!