- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
SqlCommand command = new SqlCommand ();
command.Connection = connection;
command.CommandText = "select data from filestorage where id=@id;";
command.Parameters.AddWithValue ("@id", fileId);
command.CommandType = CommandType.Text;
byte [] data = (byte []) command.ExecuteScalar ();
System.IO.Stream outStream = Response.OutputStream;
Response.ContentType = "Application/octet-stream";
Response.AppendHeader ("Connection", "keep-alive");
Response.AppendHeader ("Content-Disposition", " attachment; filename = \"" + fName+"\"" );
outStream.Write (data, 0, data.Length);
Response.End ();
видимо пхппист
В зашитом имени SQL клиента.
В кешировании файла ввиде массива байт (хотя можно ведь было стримом связать)