c# - Mantaining state for a list of documents without storing them in the database or the file sistem -
hi have situation need upload multiple files fileupload controler , display them on page.
this may stupid question because have no experience in webforms ever , need able maintain files on page without storing them in database or on server until user presses post button.
my experience related more asp.net mvc , web api.
each time user uploads new file file get's displayed on page how functionality looks:

when use presses button should able have access files can store them in database , on filesistem.
because of way database designed can store file on database can keep track of until user writes in teaxtareaand posts data.
the thing comes mind storing files in session , collegue suggested should store filename in session , store file content in bytes somewhere else.
i tought of actualy getting path of file , store along side filename in session looking @ fileupload object not seem have access filepath.
my last ideea store file contet in hidden input while debugging realized each time upload new file page_load get's runed , litle know webforms means page refresh making loose hidden input's along there data.
can suggesst solution problem?
i not store files in session. storing files in temporary folder guid (since want them unique) name , storing names in session idea. if want keep original file names can append guid file name. need remember delete files temp folder once you're done, , perhaps (for added safety) run scheduled task deletes unneeded files temp folder.
Comments
Post a Comment