views:

64

answers:

1

I'm creating a Zend Form which includes a Zend Form Element File to allow the user to upload a file. When there is an error on the form (i.e. validation fails), when it is re-displayed for the user to correct, the file upload box is empty (so they have to click browse and select it again).

Is it possible to get it to save the file?

+2  A: 

There is absolutely no way of a html input element to have pre-selected file (it’s a security issue). The only thing you can do is to save the file, and don’t require it to be uploaded again on form re-send.

Maciej Łebkowski