Announcement Announcement Module
Collapse
No announcement yet.
Question; how to persist uploaded files between requests.... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question; how to persist uploaded files between requests....

    Hi,

    By default we do not use Sessions, and everything can be rebuilt from the request params.

    The problem is that we have a sequence of pages, the first of which allows the user to upload a file. What I want to be able to do is state that the continuation strategy is server side file backed, and then stick the byte[] in the flow scope. This way there is still no session allowing for server dying/recovering between requests etc.

    But how do I do this? Do I have to write my own FlowExecutionStorage that serialises to disk or can I intercept the "about to serialize/deserialize" lifecycle and do my persistence of known file objects then?

    Many thanks,

    Colin

  • #2
    One possibility is to use a decorator implementation of FlowExecutionStorage. This could wrap your existing client based implementation, but be responsible for separately persisting one or two named elements elsewhere.

    It could be supplied with a number of attribute names that it could check the flow scope for when storing/loading the flow execution. If it encounters one of those names it could, eg. serialize its value to the database as a blob and substitute the value in the flowscope with the saved id, or save it to the filesystem and substitute the string file path. When loading the flow execution it could reverse the substitution.

    This could be quite reusable. What do you think?

    Comment

    Working...
    X