<div onclick=\"OpenObject('" + Server.UrlEncode(URL) + "')\"><a>" + FileName + "</a></div>
private void openFile()
{
string FilePath = Server.MapPath(FileURL);
FileInfo fi = new FileInfo(FilePath);
FileStream fs = new FileStream(FilePath, FileMode.Open);
byte[] bytes = new byte[(int)fs.Length];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fi.Name, System.Text.Encoding.UTF8).Replace("+", " "));
Response.BinaryWrite(bytes);
Response.End();
}
openFile()可以在页面回调加以区别后调用