I'm having a problem with FAPI in 5.1. I have a multistep form (6 steps) with redirect set to false (if that matters) and enctype set to multipart/form-data. On the third step I have several file upload fields. I notice that when I finally redirect on (only have #redirect = true for the final step) after my final step, my php code is not able to see the files that were selected for upload in the third step. Do I have to deal with the files in the following step (step 4) in order for me to have the files uploaded, or is there a way to persist the filenames to be uploaded so they will upload after the final step?

Comments

Island Usurper’s picture

I've been having problems with making fields persistent when they're more complex than a string, too. I was lucky in that I didn't need the complicated fields (a set of checkboxes) until the last step, so I'm able to process the form then. I just couldn't use the back buttons I made and come back to that step with the checkboxes already filled out the way I had them.

I guess this is really just a "Me, too" post.

-----
Übercart -- One cart to rule them all.

mscdex’s picture

Well, all of my other fields persist just fine. However, the fields of '#type' => 'file' do not persist at all.

Island Usurper’s picture

For most of the fields, I had to resort to putting hidden fields with the form data in them for subsequent steps. I haven't found a similar method for a set of checkboxes because it returns an array of values. I tried serializing that array, but maybe I should have used html_entities() too.

-----
Übercart -- One cart to rule them all.