Title too long when creating a page

I’ve got a structure field with just a textarea field inside.
In a hook, I create a subpage and use the text entered by the user in the textarea as a title for this subpage.

When saving my change in the panel, I’ve got this pop-up error:

The form could not be saved

Exception: Whoops\Exception\ErrorException
    mkdir(): File name too long 

For instance, it occurs with a text of 337 characters

http://www.linfo.org/file_name.html

A bit long, isn’t it?

Indeed, it is :wink:

Kirby use the slug to give a name to the folder created in the file system?
If yes I can reduce it programmatically and keep the page title with the entire text.

Yes, but you can use anything for the slug when creating the new page, you can either shorten the title or use a timestamp or whatever, if the slug is not important.

Thanks, I will change how I generate the slug to reduce its length.