framework icon indicating copy to clipboard operation
framework copied to clipboard

[Bug]Token mismatch on large file upload

Open emincansumer opened this issue 13 years ago • 8 comments

When I try to upload a file nearly 24 mb, I am getting a token mismatch error. Validation rules has a 'max:2048', so I should get an "The :attribute may not be greater than :max kilobytes" error instead of this.

emincansumer avatar Nov 20 '13 08:11 emincansumer

Sounds like you have a CSRF token problem. Make sure you are sending the CSRF token with the file upload.

taylorotwell avatar Nov 20 '13 14:11 taylorotwell

  • it works with an image smaller than 2048 kb - validation passes
  • it works with an image bigger than 2048 kb - validation fails
  • it works with an 3 mb mp3 file - validation fails
  • it doesn't work with an 14 mb exe file - token mismatch error
  • it doesn't work with an 24 mb wmv file - token mismatch error

I tried these tests but always getting 'Token Mismatch Error' with the last two. I am sure that token resides in form like

<input type="hidden" value="NlourC3ZGUdlztnDhxgMn1Etww8fSYXVsDVaO9zO" name="_token">

and sent . On the error page '_token' key is in _sf2_attributes. But POST Data is empty.

emincansumer avatar Nov 20 '13 15:11 emincansumer

I'm having the same issue on 4.1, works on small files but not large

swiftdv8 avatar Jan 15 '14 16:01 swiftdv8

Yeap, i noticed this as well a few days ago, on Latest 4.1.

brunogaspar avatar Jan 15 '14 16:01 brunogaspar

I still have this problem! :( any fix?

need2think avatar Sep 01 '14 14:09 need2think

I still have this problem. laravel 4.2

thangngoc89 avatar Dec 17 '14 17:12 thangngoc89

I was having this problem. Solved with help from : http://stackoverflow.com/questions/25627269/laravel-tokenmissmatchexception-with-dropzone-js http://stackoverflow.com/questions/6279897/post-content-length-exceeds-the-limit

dbrmr avatar Dec 22 '14 09:12 dbrmr

Check post_max_size.

hiendv avatar Oct 31 '16 07:10 hiendv