如何组织从服务器数据库下载的文件并在客户端计算机上打开它?
我的代码仅在服务器上打开页面时才有效:
OracleCommand oracleCom = new OracleCommand();
oracleCom.Connection = oraConnect;
oracleCom.CommandText = "Select m_content, f_extension From " + Session["tableNameIns"] +
" where i_id = " + rowData;
OracleDataAdapter adapter = new OracleDataAdapter();
DataTable tableD = new DataTable();
tableD.Locale = System.Globalization.CultureInfo.InvariantCulture;
adapter.SelectCommand = oracleCom;
adapter.Fill(tableD);
string FileName = Path.GetTempPath();
FileName += "tempfile" + tableD.Rows[0][1];
byte[] file = new byte[0];
file = (byte[])tableD.Rows[0][0];
FileStream fs = new FileStream(FileName, FileMode.OpenOrCreate, FileAccess.Write);
fs.Write(file, 0, file.GetUpperBound(0) + 1);
fs.Close();
System.Diagnostics.Process.Start(FileName);