6.0.0-beta1
7/5/25

[#14743] Form_Type_File does not get saved on preserve()
Summary Form_Type_File does not get saved on preserve()
Queue Horde Framework Packages
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester birnbacs (at) gmail (dot) com
Created 11/30/2017 (2774 days ago)
Due
Updated 11/30/2017 (2774 days ago)
Assigned
Resolved 11/30/2017 (2774 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/30/2017 06:04:17 PM birnbacs (at) gmail (dot) com Comment #3 Reply to this comment
I see. But then, if form1 uploads the file it is already on the server.
What would be the preferred method of passing the file's name to form2?
11/30/2017 04:33:43 PM Jan Schneider Comment #2
State ⇒ Not A Bug
Reply to this comment
Again, this is because you cannot set a default value (by preserving) 
of a file field for security reasons.
11/30/2017 08:47:17 AM birnbacs (at) gmail (dot) com Comment #1
Priority ⇒ 1. Low
New Attachment: filebug.php Download
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ Form_Type_File does not get saved on preserve()
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
I whish to process a series of forms in a minor variation to 
https://wiki.horde.org/Doc/Dev/FormPackage. Form variables in a step 
are saved in the $vars object to process the successive step. All 
works well unless the variable is of type file.

I included a demo script that illustrates the point. If FormStage1 
uses a variable of type integer everything works. However, if the type 
is file the gathered information is an array and preserve() fails:

dumping vars object:
Array
(
     [f_file] => Array
         (
             [name] => parsedFile-5.docx
             [type] => 
application/vnd.openxmlformats-officedocument.wordprocessingml.document
             [tmp_name] => /tmp/phppIjQKh
             [file] => /tmp/phppIjQKh
             [error] => 0
             [size] => 35069
         )

     [stage] => 2
     [f_bool] =>
)

Saved Queries