Ncls's avatar
Level 3

Remember image upload after validation

Hi, I've been reading a lot about how to remember a file upload after validation..

I tried setting the name of the file to a hidden field, the problem is that when you revalidate, the validation is still looking for a file.. But it doesn't exist anymore.. It has become a hidden field

Does anyone have a solution for this? Thanks!

0 likes
3 replies
phildawson's avatar

A. upload the file to a /tmp location and move on successful validation. B. Have the upload by itself rather than part of the other fields, create the entry and then redirect to edit with the other fields.

Ncls's avatar
Level 3

So it's a good start to have an UploadController to handle the uploads? But how do we let the UserController know that the upload was successfull. ajax? jquery Fileupload?

bobbybouwmann's avatar

If you really want to do this I suggest you to use javascript ;) Check before the form is even send ;)

1 like

Please or to participate in this conversation.