Davis Dimitriov
Davis Dimitriov

Reputation: 4257

ASP.NET File Upload without storing on the server

I have an ASP.NET 2 application and would like users to upload a file to be processed immediately. The file never needs to be used again, so I don't care to store it on the server as a file somewhere, which hopefully will make it more secure on our end.

Basically, they upload an excel file and I process it and display some results. I do not care to save that excel file for later.

How can I do this?

Upvotes: 0

Views: 1394

Answers (1)

Oded
Oded

Reputation: 499002

You can hold the file contents in a MemoryStream.

This will ensure it is not saved to disk.

See What is the best practice for storing a file upload to a MemoryStream (C#)? for details.

Upvotes: 2

Related Questions