Does anyone know of a base class that can be used to serve up an arbitrary file (potentially dynamically generated and temporary) from ASP.NET?
The kind of interface I'm thinking of would very simple and look something like this:
class FilePage : Control // I think...
{
protected Filename { get; set; } // the filename to dump out
protected bool Delete { get; set; } // Delete the (temporary) file when done?
protected string ContentType { get; Set; } // MIME type of the file
abstract protected void BindData();
}
you would derive from it and, in the abstract method, create whatever file you need to, set the properties and let the base class handle the rest.
My current use case is that I want to export data as an SQLite database.
edit:
- Superfiualy related to this question except that I must generate a temporary file.