Welcome Guest, Not a member yet? Register   Sign In
CI3 file upload via ajax with csrf
#8

(06-04-2020, 02:54 AM)InsiteFX Wrote: Please use code tags when listing source code it makes it easy to read.

Remove the space in each tags:

[ code] your code [ /code]

Or just use the forums advanced editor.

(06-04-2020, 10:36 AM)dave friend Wrote: Are you adding a hidden field to #documents-form with the CSRF name/value pair?

You should be. If you do then FormData(this) will pick up all form's fields without you having to explicitly append them to the formData object.

Remember that the CSRF hash will change each time the server receives a POST.  So the value of the CSRF field on the form needs to be updated if you plan to make another POST without first making a GET to refresh the whole page.



Yes, I am doing that.
Reply


Messages In This Thread
CI3 file upload via ajax with csrf - by Goddard - 06-03-2020, 07:43 AM
RE: CI3 file upload via ajax with csrf - by Goddard - 06-08-2020, 12:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB