We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting 419 error. How to Pass CSRF token for Laravel Upload Ajax request?
The text was updated successfully, but these errors were encountered:
@devravik
Using v-bind to replace the upload url works for me:
<v-uploader @done="uploadDone" v-bind:upload-file-url="'{{ '/foo/file-upload?_token=' . csrf_token() }}'"></v-uploader>
Sorry, something went wrong.
如果使用组件的 可以这样实现 1 在 blade 中 <meta name="csrf-token" content="{{ csrf_token() }}"> 2 在 app.js 中
<meta name="csrf-token" content="{{ csrf_token() }}">
var csrf_token = document.querySelector('meta[name=csrf-token]').getAttribute('content'); const uploaderConfig = { uploadFileUrl: 'api/upload/publicFileUpload?_token='+csrf_token, fileTypeExts: "jpeg,jpg,png", showMessage: (vue, message) => { vue.$dlg.alert(message); } };
$.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } });
Try this.. Hope it will help you
No branches or pull requests
Getting 419 error. How to Pass CSRF token for Laravel Upload Ajax request?
The text was updated successfully, but these errors were encountered: