The file field is used to manage and associate various file formats other than images, such as PDF, CSV, ZIP, and Excel.
It is suitable for use cases like distributing white papers and sharing product specifications.

Please refer to the following documentation for uploading using the API and CSV.
Setting Item | Description |
|---|---|
Required Field | When enabled, input is required during submission. |
Description Text | This is the description text displayed on the submission screen. |
Default Value | You can set the default value for submissions. |
Please refer to the documentation below for details.
The file field is returned in object format, so you create a link by referencing the url property.
Below is an implementation example that displays a link to a PDF document using Next.js.
export default async function Page({ params }) {
const { slug } = await params;
// Fetch data using the microCMS JavaScript SDK (https://github.com/microcmsio/microcms-js-sdk)
const data = await client.getListDetail({
endpoint: "blog",
contentId: slug,
});
return (
<main>
{/* file is the field ID. Replace it with the actual field ID */}
<a href={data.file.url} target="_blank" rel="noopener noreferrer">
Download the document
</a>
</main>
);
}