Skip to content
New issue

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

bug found using official demo #956

Closed
jcyuan opened this issue May 3, 2017 · 1 comment
Closed

bug found using official demo #956

jcyuan opened this issue May 3, 2017 · 1 comment
Labels

Comments

@jcyuan
Copy link

jcyuan commented May 3, 2017

Originally I found the weird behavior from my app, then I had a test using the official demo:
http://plugins.krajee.com/file-input-ajax-demo/4
and the bug appears again.

To reproduce the bug:
1, select 3 images from disk, then click upload
2, click remove icon of the last item from the preview list to delete the last one
3, click browse to select 2 files then upload (then here 4 items in the preview list)
4, remove the last one again (3 items remaining)
5, click browse and now just select 1 file form disk and then upload, once the uploading process done you will see 5 ITEMS in the preview panel!

@kartik-v kartik-v added the bug label May 3, 2017
@jcyuan
Copy link
Author

jcyuan commented May 3, 2017

Man, besides I have a requirement.
Is there a way to always attach some data to ajax request? although I could use uploadExtraData or deleteExtraData or 'extra' config for each preview items but for my case:
I need to attach an Anti-Forgery token for every ajax reuqests to prevent my site from CSRF attacking.
uploadExtraData is useful for uploading, I can attach the token.
but I think there is no way to put the token into the 'extra' config which generated from the serverside.
because the token cannot be generated by server (client cookie is involved). so I need a way to modify the 'extra' config to add my token variable while deleting.
temporarily I inserted a new line:
extraData = $.extend({}, myCustomGlobalData, extraData);
at line 2249 of the source code and it works fine.
or actually there is already a way to do this but I just dont know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants