I'm using Dropzone with Laravel and no other threads about this problem have solved my issue.
Currently I load dropzone.js from a cdn.
And, as told in their doc, I just use these lines where I had to include the token with Laravel:
<form
action="{{ route('store_photo_path',['zip' => $flyer->zip, 'street' => $flyer->street]) }}"
class="dropzone"
>
{{ csrf_field() }}
</form>
On my PhotoController, the token arrives right so data is being recieved, but file is totally empty, so I can't manipulate the images. Here is the AJAX response (Laravel's Request object type):
{"_token":"Ng24JDmKn3ylX6p5sFmFvgDcsLp983BZ8IL7pXIN","file":{}}
I'm not using any kind of jQuery method or extending Dropzone behaviour, just trying to make it work in the most simple way Dropzone says it should work. I've checked including enctype does not work because removes the file object and Dropzone does not include it in their documentation, and you shouldn't include more input fields based on their documentation again.
Also, $_POST var has the same information (just the token and the file object empty).
Thanks.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire