Welcome Guest, Not a member yet? Register   Sign In
how to transfer large data across a redirect
#5

[eluser]boltsabre[/eluser]
Why are you storing error messages in the flashdata? CI comes with form validation built in, check the manual.

What I'd do is do all your form validation using JS... once it passes that only then will the form submit to your php/ci controller. It's a bit more user friendly because no page reloads when validation fails, thus the user only need to "select file to upload" once (which can be a drag if it's deeply nested within the folder tree/structure).

Now your file only get's uploaded once from their machine to your local temp folder on your server once JS validation has passed.

I would still do php form validation, we all know how bad it is just to rely on JS validation!!!

The only reason the php validation should fail if the user is malicious and doing something naughty, or they are one of the 0.01% of users who have JS disabled. Either way, just reload the page/form if validation does fail server side.

Only once the form passes both JS and PHP validation do you need to worry about the file upload.

Sounds a bit like to me you're making a complex solution to a simple problem (which we all do from time to time!).



Messages In This Thread
how to transfer large data across a redirect - by El Forum - 02-03-2014, 01:02 PM
how to transfer large data across a redirect - by El Forum - 02-03-2014, 01:06 PM
how to transfer large data across a redirect - by El Forum - 02-03-2014, 02:47 PM
how to transfer large data across a redirect - by El Forum - 02-03-2014, 02:57 PM
how to transfer large data across a redirect - by El Forum - 02-04-2014, 06:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB