akc4's avatar
Level 1

1406 Data too long for column 'payload'

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'payload' at row 1 (SQL: update `sessions` set `payload` =

I get this error while trying to upload an image, the image is 69kb. It creates a very long payload string. payload type is set to text in my database. However, in my request validation I have set the max size to 15kb.

'logo' => 'nullable|image|max:15',

Is the validation getting ignored here?

0 likes
1 reply
akc4's avatar
akc4
OP
Best Answer
Level 1

I found the problem.

I am using Jetstream with vue/inertiajs and on that example I was trying to update data with the "PUT" method, but reading the documentation here https://inertiajs.com/file-uploads. I should use the method "POST" instead and add "PUT" in my form data.

Please or to participate in this conversation.