Reputation: 5271
I have a rather extensive form which contains a file input. The form will be returned if there are errors and all the other inputs will be repopulated with the existing $_POST data. It is not possible to re-populate and image input.
Does anyone have any suggestions on how resend the posted file without storing it temporarily on the server (otherwise there could be a large build up of temporary files).
Cheers,
Upvotes: 0
Views: 50
Reputation: 3348
You don't really have a way around that... You have two options here.
Upvotes: 1
Reputation: 943624
You could encode the files using the data: scheme, then stuff that in a hidden input in the form.
… but that would be a horrible waste of bandwidth (especially if the files are on the large side).
Storing temp files and having a sane housekeeping policy (such as delete all files over 10 minutes old every 5 minutes) is the way forward.
Upvotes: 1