Morgan Herlocker
Morgan Herlocker

Reputation: 1483

Maximum amount of data stored in ASP.net session variables

I have a form where users can upload Pdf files(about 30 pages to one document or so). I want to delay storing these Pdfs in the database until the user submits the entire form. The problem is that the collection of files uploaded must be able to persist through postbacks. That being said, I am considering storing these as session variables, however, would this be too much data to store, or are session variables meant to store a couple strings here and there? If this method is not acceptable, is there an alternate method?

Upvotes: 0

Views: 2283

Answers (2)

Mark
Mark

Reputation: 11740

The amount of data you can store in session variables is limited only by amount of memory on your server(s) (if you're using a session persistence system that uses memory). You need to calculate how many concurrent users you want to serve on a machine, figure out how much memory you'll use per session, and figure out whether or not you've got enough.

Upvotes: 0

Aliostad
Aliostad

Reputation: 81660

It is a request for disaster.

Store them on disk or SQL as temp, and only store the path or id to them. As you said it yourself "session variables meant to store a couple strings here and there"

I think even path or id must be stored in database as well so that if your server recycles the session, you do not lose all that data and user could have it for a period of time until a timeout which you clear the files.

Upvotes: 2

Related Questions