Colin_Laws's avatar

Do file uploads complete before being processed by Laravel?

I am building an SPA that includes a file upload system. Our users will be uploading fairly large files. My concern at the moment is that my JWT will expire before the upload is complete. This would cause the client to refresh their token, and attempt to resend the entire file again and again.

My question is in regards to how file uploads are processed. My guess is that the request isn't processed by Laravel until the entire file upload is completed, and then the server passes that request to Laravel. Ideally, I would want the request to be authenticated by Laravel first, and then have the file streamed to the disk, but obviously you can't do that until the file is in memory.

I know I could probably write up a test controller just to see when my middleware for JWT-auth is getting hit, but I thought I'd ask because I'm curious about the relationship between the server and the code.

0 likes
0 replies

Please or to participate in this conversation.