Files Uploaded Via Ajax on Laravel Production Site Returned MethodNotFound Exception

I spent days trying to figure out why files weren’t uploading when I moved my Laravel app to the production server. After hours of trying different things I found in forums and Stack Overflow, this is what worked for me.

Works on local server

<form id="uploadFilesForm" action="/order-upload-file/{{ $order->id }}/" class="dropzone">

Changed to make it work on production server

<form id="uploadFilesForm" action="/order-upload-file/{{ $order->id }}" class="dropzone">

Notice I had to remove the trailing slash in the action on the production server. After I did that the files uploaded with no errors.

Hope that helps someone.

Leave a Reply

Your email address will not be published. Required fields are marked *