Im having 16 file upload fields in a multipage form and Im doing a size and ext check after submit button and checking is server side.
the problem Im having is that the if filefield1 fails a faill msg is shown (as Im doing action redirect when failure) but all filefield2 / filefield3 / filefield4 ..... loses the file selected. is there a way a just keep the value for the file selected on those file fields.
Don't use a redirect use an event loader. You can also use a switcher area for each field with {var.empty:fileuploadactionname} with the "true" event showing the field (because if it's empty, no file was uploaded and you need to show the field. If it's false, a file WAS uploaded and you don't need to upload again.)
yes well spot on.
Actually I was using event loader.
Can I use the action name inside the fieldswitcher even before calling??
Im still not getting the idea can you pls explain it more?
could you pls confirm that the path is preserved using switcher area????
What I really need is to preserve the file paths and file name when the fail is triggered so that all file selected for upload are kept intact unless user click on browse and select another file.
any idea?
Hi saveg,
Personally I would keep it simple and upload the files from each page when that page is submitted and I would save the data to a 'provisional' database record at the same time. When the next page is submitted upload the files from that page and update the database record. On final submission validate the data and change the status of the record from 'provisional' to 'confirmed'. To keep things tidy you can also run a cron job every so often to look for 'provisional' records more than say 24 hours old and delete the corresponding files and the record.
You don't normally have access to the path of the files on the users computer - though I guess it might be possible to grab it using JavaScript.
Bob
I meant would you the switcher area fix this problem?? and if yes Im can someone explain the logic clearly?
ive done {var.empty:upload6} and its working fine and not showing in the next event loader.
it did the trick and well done for the idea, but if the user again makes wrong file type upload for the next submit. the file field acually shows again. how can I prevent it from re showing once it successful ie never show once the file is accepted no matter the number of submit ?
dont forget we have 16 files to upload and user is dumb enough to make wrong types and sizes. we want to fully control it?
anyone there???
can I use double switcher area to overcome this problem??? is it nested switcher area or how can I overcome this problem
Costs you nothing to try. Could also store in session with data builder 2 that the file was uploaded and use {session.empty:namegoeshere}
thanks for clarification. actually I did do {session.empty:actionnamehere} and seems to be working. just wondering will this eat up memory on the server as I will endup doing 19 sessions created and saved
Unless you have billions of concurrent users I doubt it's going to matter.