Search code examples
filesessionvariablespdftemporary

Session variable or temporary flie on client post?


My application web ASP.NET can launch a lot of reports and I need to store temporary the pdf file before to show the report.

So, which is the better way to store temporary a pdf file ? This is for few seconds or maximum few minutes, the pdf file can have several hundred pages and a lot of users can launch the reports.

In a session variable or in a temporary file ?

Thank you.


Solution

  • According to me it should be a temporary file. Storing that in session memory not a good practice even if it one/two pages. It would be difficult to scale to multiple users. Imagine have 10 users using the app and having 10 files in memory. You will be better of using the memory for other reasons than files in memory.