# Write file content data

**URL:** <https://forum.getkirby.com/t/write-file-content-data/16229>\
**Category:** Questions\
**Tags:** v3\
**Created:** [November 8, 2019, 9:54am UTC](https://forum.getkirby.com/t/write-file-content-data/16229 "2019-11-08T09:54:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajk](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/ajk/32/5063_2.png) [@ajk](https://forum.getkirby.com/u/ajk)\
**Post date:** [November 8, 2019, 9:54am UTC](https://forum.getkirby.com/t/write-file-content-data/16229/1 "2019-11-08T09:54:21Z")

</div>

Every file can have a blueprint right? So even for pdf files its possible to write a blueprint with fields to store some extra data - right?

If yes: In the panel read and write is not a problem.  
Read in the frontend / templates is also not a prloblem with $file-\>fieldname(); or $file-\>content()-\>fieldname();

But how do I write?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 8, 2019, 10:00am UTC](https://forum.getkirby.com/t/write-file-content-data/16229/2 "2019-11-08T10:00:04Z")

</div>

You mean write to a file from the frontend or programmatically? Then `$file->update()` is what you are looking for:

> **[$file-\>update()](https://getkirby.com/docs/reference/objects/file/update)**
>
> Updates the model data

---

<div class="post-metadata">

**Author:** ![ajk](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/ajk/32/5063_2.png) [@ajk](https://forum.getkirby.com/u/ajk)\
**Post date:** [November 8, 2019, 10:01am UTC](https://forum.getkirby.com/t/write-file-content-data/16229/3 "2019-11-08T10:01:10Z")

</div>

That simple! 😃
