0

405 Method Not Allowed

  • I'm getting this error and my request url is null tho i've set the callback
  • I've also tried @action="" but I got the same result

Request URL: http://localhost:8000/callback/null

Request Method: POST

Status Code: 405 Method Not Allowed

<vs-upload automatic :action="upload" fileName="file" @on-success="successUpload" />


export default {
 methods:{
  upload (file) {
    this.$store.dispatch('some/callback', file)
  },
  successUpload() {

  }
}

500 Internal Server Error

  • Symfony\Component\Routing\Exception\RouteNotFoundException: Route [login] not defined.

Request URL: http://localhost:8000/api/upload

Request Method: POST

Status Code: 500 Internal Server Error

<vs-upload automatic action="/api/upload" fileName="file" @on-success="successUpload" />

export default {
 methods:{
  successUpload() {

  }
}
3
  • Welcome to SO .. it redirect to Route [login] not defined means you need to add authorisation in api/upload Commented Feb 11, 2021 at 6:48
  • @KamleshPaul api/upload is inside the middleware. csrf_token is present on the main blade. where do i put the authorization? I have also tried to put headers on vs-upload but no luck :( Commented Feb 11, 2021 at 6:53
  • csrf and auth token is totally difrrent Commented Feb 11, 2021 at 6:54

1 Answer 1

1

you need to add header to authorisation

i assume you are using token based auth as you are using vuejs

so solution is

 <vs-upload automatic :headers="{'Authorization' : token}" action="/api/upload" fileName="file" @on-success="successUpload" />

you need to add headers="{"Authorization" : token}"

https://lusaxweb.github.io/vuesax/components/upload.html#automatic . you can check here available params

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.