Laravel+Plupload uploading to S3 response for preflight is invalid - CORS Laravel+Plupload uploading to S3 response for preflight is invalid - CORS nginx nginx

Laravel+Plupload uploading to S3 response for preflight is invalid - CORS


I found a way to achieve it poorly. Studying http://laravel.com/docs/master/filesystem deeply I didn't found a valid answer to get Plupload working. Otherwise, I found a poor solution that is using a:

<input type="file" name="files[]" multiple>

And use something like:

foreach($request->file("files") as $file) {        Storage::put(            'test'.rand(1,100),            file_get_contents($file->getRealPath())        );    };

In my controller, that enables multiple file uploading to S3. But it isn't asynchronous and also it's UX is worse.

I'll keep working to have Plupload enabled eventually. I will post updates here.


It maybe worth you looking at the cors package by Barryvdh:

https://github.com/barryvdh/laravel-cors

This fixed my CORS issue.