Announcement Announcement Module
No announcement yet.
persisting file input streams across views Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • persisting file input streams across views

    hmm, how best to describe this. i have successfully implemented reading an excel file via input stream and spring. now i'm trying to do something a bit trickier and i'm not sure if it's even possible. users will have an excel sheet with a layout and data. i have an excel api that reads the information quite nicely. however, i would like to break this down into 2 steps while only requiring the user to upload the file once. the user would upload the file and the column headers would be echoed back to them so that they could create a template (column mapping) to tell me what information goes where on this file. the app would take the information from this intermediate form and apply it to the uploaded document data. is there any way to persist the data in the input stream while processing the intermediate form? i'm trying to avoid saving a copy of the file on the server or requiring the user to upload the same file twice.

  • #2
    If I'm not mistaken, if you want to persist such a piece of information between two requests, you'll have to use a serializable object somewhere, whether it is to pass in the response (not feasible in the case of binary data), stuff it in the session (even if it is not to be serialized most of the case)... The most clean way of achieving this would be to convert your file into an internal structure when the file is uploaded first, and from this java structure to allow configuration and retrieving of data according to it.
    If this is far from your current implementation, storing the file in a temporary file and associating a filename to the user session/response seems the most appropriate.



    • #3
      sorry for the delay ... thanks. it's what i figured i would hear but figured i would check anyway, just in case. i'll just save the files temporarily on disk and delete them when i'm done.