I'm developing a REST API with Laravel as the backend of my app. The frontend is made with React/Redux. The server is a Windows IIS machine.
I'm having a problem submiting a list of attachments to a model. The upload process from the frontend is the following one:
So in the end, we can have multiple concurrent requests, each calling file_get_contents to an url located in the same server, which shouldn't be a problem.
Problem is it crashes when I upload more then 1 file, but it's random. So the more files I upload, more probability of crashing. It crashes 100% of the times with more than 3 files. All requests are seen as pending on Chrome dev tools, and after some minutes they return "Error 500 failed to open stream: HTTP request failed!".
Things I've tried:
Looks like a race condition to the filesystem. But I don't understand why, all files that need to be read are different.
Don't know what else to do. Can somebody help?