Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6233385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:17:22+00:00 2026-05-24T10:17:22+00:00

I’m wondering. If I have a form that is broken up into steps where

  • 0

I’m wondering. If I have a form that is broken up into steps where I allow users to upload various files, can I keep those files in TempData as binary data?

I need to be able to Save the file to disk, as well as save it to a database.

I have a single index.cshtml for a ViewModel that on each post, displays an editor for a property of the ViewModel that is of type IStepViewModel So each step represents a portion of the total data to be collected.

This way I can have 1 index.cshtml page to manage, and as many steps as I want.

The client wants some steps to allow uploads, and others won’t. They also want the uploads to be Ajaxy, which means posting while a step may be incomplete.

I want to be able to on the last review step, let them know here are the files you are thinking about uploading…Until they click the final TRANSMIT the files are in TempData, This way I think I can have a single atomic operation.

The operation would
– Save all the form data once again to DB
– Mark the database record with a bit flag of transmitted
– Save the files onto our server

Maybe there is a completely different approach I should be taking…If so, please let me know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:17:22+00:00Added an answer on May 24, 2026 at 10:17 am

    TempData uses session store to store data, thus anything that can be serialized can be saved there.

    However, in your case, saving files in session store is probably not a good idea as you can easily run out of memory.

    A solution would be used a tempfile based storage (you can even implement a temp db/file based session store.

    • As a user uploads the files, the files are written to a temp folder on a server (it could be a centralized one if your application is web farm based).
    • A pointer to the temp folder is stored in TempData.
    • Once the wizard process completes successfully, these files can be moved to DB and permanent fileserver.
    • Your app can decide to purge the temp files or a nightly job can purge those files.

    This would avoid multiple trips to DB and unnecesary I/O on DB.

    You can also make SQL Server as the backing store of your session or some other DB (oracle) that persists temp data. This way, your app deals with TempData and is agnostic of how the temp files are stored.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.