Fileupload over routes

I like to uploads files via extension router. But it breaks after 20Kb and i get an 404. Is there a time/size-limitation? Is there another way to do this?

What does that mean? The logic for uploading is in a route?

Yes, exactly. Here is a thing to test:

'routes' => [
    [
        'pattern' => 'upload',
        'method' => "POST",
        'action'  => function () {
            return $_FILES;
        }
    ]
],

It works only with small files.

Hm, but in the Panel, you can upload large files?

Yes, but not as public user via a form.

Are you authenticating your upload request (either user logged in or impersonated user via $kirby->impersonate()`?

I’m working on my Form Block Plugin (again).

To be more flexible, i need to validate the form via Javascript over an Api. But i need an Interface for that with all the Kirby instances available.

Files need to be stored in the Content-Folder. There’s already a few safety thing inside, to prevent an attack of the panel.

Do you have an idea?

To answere you question: I’m using $kirby->impersonate()

Have you checked the error logs?

No errors here. The parameters upload_max_filesize , post_max_size and memory_limit are on the top.

Well, yes, that’s why I was asking if you could upload bigger files via the Panel.

Hm, I have no clue. Does it work if you do a simple frontend upload, without any JavaScript involved? If yes, then I would assume that there is some sort of error in your code.

Yes, there is a bug anywhere else. It’s hard to debugging trough routers.
I keep on working on it and let you know.

Are you familiar with xDebug? Should help you to debug this.

Tried. I just can’t get the xDebug to run on my Mac. I would need a debugger to debug the debugger. :see_no_evil:

The maybe use Ray app or it’s open-source alternative Kint